| Start |
|---|
| *ngFor form1.component.ts: Output: In its most simple form, In the case of Apples, Oranges, and so on are the values inside the array
Unlike AngularJS, Angular2 has not continued with the use of
References: Angular2 | Displaying Data (opens new window) Angular2 | ngFor (opens new window) Angular2 | Forms (opens new window) |
Attribute directive |
Component is a directive with template |
Structural directives |
Custom directive Usage: |
| Copy to Clipboard directive In this example we are going to create a directive to copy a text into the clipboard by clicking on an element copy-text.directive.ts some-page.component.html Remember to inject TEXT_COPY_DIRECTIVES into the directives array of your component |
| Testing a custom directive Given a directive that highlights text on mouse events It can be tested like this Syntax` - Binds attribute `data-note` to variable `note`.
RemarksThe main source of information about Angular 2 directives is the official documentation https://angular.io/docs/ts/latest/guide/attribute-directives.html (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference