Angular 2 Building Blocks - Handson.txt - What is Angular 2 It is a JavaScript framework for creating web and mobile applications It supportsTypeScript

Angular 2 Building Blocks - Handson.txt - What is Angular 2...

This preview shows page 1 - 3 out of 9 pages.

What is Angular 2?It is a JavaScript framework for creating web and mobile applications.It supportsTypeScript, a super script of Javascript that helps in safe coding.It has several enhancements on top of Angular 1.x, which makes it simple to use and get the desired output. But knowledge in Angular 1.x is not necessary to learn Angular 2, since the whole framework is re-written.Why Angular 2?Easy: Unlike previous versions, Angular 2 focuses only on building JavaScript classes; hence it is easier to learn.Freedom: It provides more choices of languages for consumption i.e. ES5, ES6, Typescript, and Dart. TypeScript is recommended here.Flexible: It is a Cross-platform framework.Faster: Because of server side rendering.Simpler: Component based approach with no controllers and $scope.Performance: Uses Hierarchical Dependency Injection system, which is a performance booster.Angular 2 Environment SetupTo setup an Angular 2 environment, node.js is mandatory. Once node.js and npm are available, you can run the following to complete the setup in cmd.Install Angular CLI(command line interface) Command: npm i -g @angular/cli (-g installs angular globally for all users)Install TypeScript Command: npm install -g typescriptArchitectureYou can see that the architecture of Angular 2 consists of eight basic blocks. In order to learn Angular 2, a good understanding of architecture is necessary.------------Angular 2 uses ______ Dependency Injection. HierarchicalThe following are true about Angular 2, except ________. Angular 2 extensively uses $scope object to implement MV* pattern------------What is Module?A Module is a way of organizing related Components, Services, Directives, and Pipes with a specific functionality.It is a block of code meant to do certain tasks.There can be several Modules within an app, but it should consist of at least Module - Example
Background image
This is a sample code for module.import { NgModule } from '@angular/core';import { BrowserModule } from '@angular/platform-browser'; @NgModule({imports: [BrowserModule],declarations: [AppComponent],bootstrap: [AppComponent]})export class AppModule { } // AppModule Class is now defined as Module : @NgModuleTrick to identify Root Module is that it imports "BrowserModule". Other modules of that same application imports "CommonModule".
Background image
Image of page 3

You've reached the end of your free preview.

Want to read all 9 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture