Angular 2 Has a Lot of New Syntax

Angular 2 Has a Lot of New Syntax

So I’ve been learning quite a bit of AngularJS 2 lately and want to share the new syntax it offers. This is from the ng-book mob but I will extend it in the coming weeks.

Angular 2 Has a Lot of New Syntax

Annotations
The @ is an annotation and it comes from TypeScript

Multi-line Strings
Using ` backticks allows for easy inline templates

Brackets for Parameters
Use [] brackets on an attribute to pass parameters to the directive

Class Syntax
TypeScript allows you to define classes using the class syntax

Events
One-way data binding means we fire events instead of modifying data directly

Actions
Our class defines actions that we can use in our view

Components
Components teach your browser new tags

Views
Views can be defined by the template option

Star Syntax
Use the * on an attribute to use a directive on this element

Parenthesis for View Actions
Use () parenthesis to specify action bindings

Strong Typing
TypeScript lets us define collections that contain our custom type Product

Component Definition Class
We define new Components with a class

Conclusion:

So these are the Angular 2 Has a Lot of New Syntax.If you like this tutorial script then share it with your community. If you have any suggestion Feel free to comment below.If you want to learn more about PHPCodeIgniterAngularJSLaraveljQuery  Web Development then daily visit PHPCodify. Sharing is Caring.

Angular 2 Has a Lot of New Syntax

Read previous post:
angularjs logo
Branding Guidelines for Angular and AngularJS

Branding Guidelines for Angular and AngularJS In September of last year we made several big announcements. We released version 2.0.0...

Close