Learn one way to build applications with Angular and reuse your code and abilities to build apps for any deployment target. For web, mobile web, native mobile, and native desktop.
https://angular.io/
Important Commands:
- npm install -g @angular/cli
- ng new hello-world
- ng build –prod (for generating production ready files)
- ng serve and the app is available at http://localhost:4200
- To create a component use the command ng g c course
- To create services use the command; ng g s service-name
- ng add @angular/material OR npm install –save @angular/material @angular/cdk
- npm install –save @angular/animations
- npm install –save hammerjs
- ng add angular-bootstrap-md
Core Angular Concepts:
- Interpolation
- Property interpolation
- Class binding
- Style binding
- Event binding
- Template reference variables
- Two way binding
- Structural directives (allows to add or remove HTML elements)
- ngIf
- ngSwitch
- ngFor
- ngIf
- Component Interactions is achieved using @input and @output-> EventEmitter
- Pipes allow us to transform data before it’s displayed
- A service is used to get the data and component will prepare it for the view
- Dependency Injection: We can use Injector (providers array) as a container to register all dependencies
- We need to register the service as dependency in relevant component
- To make the returned response from http request usable, we have Observable concept. Observable: “A sequence of items that arrive asynchronously over time”. As a result of http call, we receive a single item instead of sequence of items. An observable is converted to appropriate format by the angular service. Then this service provide the data to the components which have subscribed to that service. To work with observable, we use javascript library RxJS (Reactive Extensions for Javascript).
- HTTP error handling is done using catch and throw modules
- Routing and navigation in Angular
- Wildcard route and redirecting routes
- Route parameters
- paramMap Observable
- Optional route parameters
- Relative navigation
- Child routes
- Wildcard route and redirecting routes
- Angular flex for layout
- Custom pipes in angular