Template in Angular 2
Template
The template tells Angular how to
display the component. We can create html pages and navigate through site
map/url for templateUrl
Benefits/Usages
- Dynamic content rendered on separate page
- Code cleanliness more manageable
- Master / child page structure can be achieved
Syntax and Code Snippet
import { Component } from '@angular/core';
@Component({
selector: 'myapp',
template: `<h1>Hello {{name}}</h1>`
})
export class AppComponent
{
name = 'Angular2';
}
.html body section
<body><myapp>Loading Please wait ...</myapp>
</body>
Template in Angular 2
Reviewed by Rupesh
on
04:07
Rating:
No comments: