Angular 2 is the latest Javascript open source client-side framework. It is very popular and useful framework available today to build powerful web applications. It is created and maintained by Google. Before going to next, I want to clear some question about Angular 2 such as why we use Angular 2? What’s new from Angular 1? What Angular 2 offers? What are the core features of Angular 2? And what are the prerequisites for Angular 2?
There are some following main features of Angular 2.
@Component({
selector: ‘my-component’,
template: ‘<div>Hello my name is {{name}}. <button (click)=”MyName()”>My Name</button></div>’
})
Templates: Componenet’s view can be defiened by templates. Templates tells the angular how to display the component. E.g. <div> My Name is : {{name}}</div>
Services: Services are the responsible for doing a specific task only. They are used for reusable data services to share between components throughout the application.
Directives: Directives are used to change the behavior of an element on the base of user input or the data that is coming from services. There are three kinds of directives such as Component Directives, Structural Directives, and the last one is Attribute directives.
Dependency Injection: Dependency injection is a design pattern that passes an object as dependencies in different components across the application.
You should have some basics knowledge of HTML, Basic JavaScript, TypeScript, Angularjs 1 (Not very important), and the basics programming fundamentals such as Functions, Loops, and conditionals etc.