Selector in Angular 2
Selector
Selector is tag identifier in
Angular 2 which is tells where the content needs to be rendered
Benefits/Usages
- Dynamic content rendered on browser
- Multipart’s of codes with clean structure to display
Syntax and Code Snippet
import { Component } from '@angular/core';
@Component({
selector: 'myapp',
template: `<h1>Hello {{name}}</h1>`
})
export class AppComponent
{
name = 'Angular2';
}
HTML Body
<body>
<myapp>Loading Please wait ...</myapp>
</body>
Selector in Angular 2
Reviewed by Rupesh
on
04:05
Rating:
No comments: