Thursday, December 14, 2017

Angular 2

1. What is Angular 2

Angular 2 is a JavaScript framework which allows to create reactive Single Page Application.

2. What is Angular CLI

Ans : A command line interface for Angular

Command to install Angular CLI :-npm install -g @angular/cli

* CLI uses Webpack  a tool which bundles all css and JS and include them in index.html file.

If you face any error installing any component from npm than run below command

npm set strict-ssl false

3. What are Directives?
Ans. Directives are instruction to DOM to do some action.


A directive is a custom HTML element that is used to extend the power of HTML.

4. What are the types of directive?
Ans. There are two types of directives one is structure directive and other is attribute directive?

Structure directive add or remove the element in DOM. Example is *ngIf, * indicate that it is structural directive
Attribute directive don't add or remove  the elements from DOM. They only change the element they were placed on.Example is ngStyle

No comments: