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 on it in the coming weeks.
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
Reference:
Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO
RT @angularjs_io: Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO
RT @angularjs_io: Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO
RT @angularjs_io: Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO
Its an awesome blog with new information’s. Thanks to share with us.
hadoop training
RT @angularjs_io: Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO
RT @angularjs_io: Angular 2 Has a Lot of New Syntax #angular https://t.co/YWvoPkY0cO