Skip to main content

Posts

Showing posts from July, 2018

Create a new component in angular

If you are Not aware of basis environment set up and Hello world of angular please go through below links for the context. 1 .  angular-4/5/6-set-up-environment 2 .  angular-5-hello-world-step-by-step Above links help us in creating ready made application which angular CLI provide us but now we want a component of our own. Step 1:    Creating a Custom Component navigate to your folder structure where you want to create your custom component and then run below command ng g component customHelloWorld like this : D:\Rakesh_kumar_Singhania\Angular5HelloWorld\hello-world-app\src\app> ng g component customHelloWorld This command will create your component and also it make sure to mark an entry in your app.module.ts file. app.module.ts -- This file holds all the source required by the project which include all the imports of the components. below is the snapshot of generated files : Beauty of command  ng g component customHell...

Angular 5 Hello world step by step

Step 1: Prerequisites Install Node.js & npm Angular 4/5/6 set up environment Install Angular CLI Creating a new Angular app is a bit tedious job especially when you are new to Typescript as there will be lot of initial configurations involved. In order make it simpler Google came up with the utility called Angular CLI, using which we can create and manage our app from command line itself In order to install Angular CLI open Node.js command prompt/command prompt and run the below command npm install - g @angular / cli Install Code Editor There are multiple code editors available in market 1. Microsoft Visual Code Studio 2. Brackets 3. Notepad++, 4. Sublime Text As I m Fond of eclipse so I have installed angular plugin in eclipse as Angular editor. Step 2: Create Project Lets build our First Angular 5 Hello World application Create a new folder with folder name “Angular5HelloWorld” anywhere you want. Open command prompt and navigate to the fold...

TypeError: Cannot read property 'thisCompilation' of undefined

Follow these steps one by one  to resolve the error on windows/linux machine npm i - g @angular / cli@latest rm - rf node_modules / rd / s / q node_modules npm cache clear - - force npm cache verify npm install npm uninstall webpack npm install - - save - dev - - save - exact @angular / cli@latest You might get below error also  webpack/lib/node/NodeTemplatePlugin' Solution npm remove webpack - g npm i webpack - - save - dev

In MemoryDatabase H2 with SpringBoot

An in memory database is created when an application starts up and destroyed when the application is stopped. That means there is no persistence of data and every time you restart or stop you application your saved data will be lost. H2 H2 is one of the popular in memory databases. Spring Boot has very good integration for H2. H2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode. H2 also provides a web console to maintain the database. Setting up a Spring Boot Project with H2 Spring Initializer http://start.spring.io/ is great tool to bootstrap your Spring Boot projects. As shown in the image above, following steps have to be done Launch Spring Initializer and choose the following 1. Choose com.rks as Group 2. Choose H2-console as Artifact 3. Choose following dependencies Web JPA H2 DevTools Click Generate Project. Import the project into Eclipse. File ...