Daily Activity Tracker
This Daily Activity Tracker Application is built in Angular.
Source Code: Angular Activity Tracker
Daily Activity Tracker
This Daily Activity Tracker Application is built in Angular.
Book Management CRUD operation using Struts and H2 Database
Question set:
Solution Source Code: Book Management
Structural Directives in Angular
Structural directives are responsible for HTML layout. They shape or reshape the DOM's structure, typically by adding, removing, or manipulating elements.
There are three NgIf
, NgFor
and NgSwitch
.
NgFor: It is a repeater directive that customizes data display. It can be used to display a list of items.
NgIf: It removes or recreates a part of DOM tree depending on an expression evaluation.
Example:
Open the terminal window and enter the below command:
Bootstrapping in Angular
Bootstrapping is a technique of initializing or loading our Angular application.
let’s walk through our code created in Create your First new Angular project and see what happens at each stage and how our AppComponent
gets loaded and displays “app works!”. The Angular takes the following steps to load our first view.
Web apps need a starting point. Index.html
is usually the first page to load. Let us open the file and find out what it contains. You will find it under the src
folder.
There are no javascript files in the index.html
. Neither you can see a stylesheet file. The body of the files has the following HTML tag.
<app-root></app-root>
How do Angular loads ?. To Find out, let us build our application.
To run our application, we use the Angular CLI command ng serve
or NPM command npm start
(npm start
command actually translates into ng serve
.)
ng serve
does build our application but does not save the compiled application to the disk. It saves it in memory and starts the development server.
We use ng build
to build our app. Open the command prompt and run the command. This will build and copy the output files to the dist
folder.
ng build
Use ng build --prod
to build and distribute the app for production. For testing/debugging use ng build
. The production build optimizes, minimize and uglify the code.
Now open the dist
and open the index.html
.
You can see that the compiler included five script files. They are runtime
, polyfills
, styles
, vendor
, & main
. All these files have two versions one is es5
& the other one es2015.
runtime.js:
Webpack runtime filepolyfills.js
– Polyfill scripts for supporting the variety of the latest modern browsersstyles.js
– This file contains the global style rules bundled as javascript file.vendor.js
– contains the scripts from the Angular core library and any other 3rd party library.main.js
– code of the application
These files are added by the Webpack module loader.
Full Article: Angular Bootstrapping Internal Working