3. template and template url
TEMPLATE WITH SINGLE LINE CAN BE USED SINGLE OR DOUBLE QUOTES
import { Component } from '@angular/core';
@Component({
selector:'app-root',
template:"hi {{title}}"
})
export class AppComponent{
title:string ='angular';
}
TEMPLATE MORE THAN 1 LINE USED BACKTICKS
import { Component } from '@angular/core';
@Component({
selector:'app-root',
template:`hi {{title}}
ABC
XYZ`
})
export class AppComponent{
title:string ='angular';
}
USING TEMPLATEURL
import { Component } from '@angular/core';
@Component({
selector:'app-root',
templateUrl:'./app.component.html'
})
export class AppComponent{
title:string ='angular';
}
Comments
Post a Comment