I would like to move the html content into .html file and use the templateUrl instead of template. I am getting 404 error. Can you please help me, am i missing anything?
@Component({
selector: 'app5',
template: `
This was rendered by App5 which is written in Angular 6
<br />
<div>
<b> Count: {{ count }}</b><br/><br/>
<button (click)="increment()">local increment</button> Send a <b>local</b> increment event. This will
only increase the counter for the current app. <br/>
<button (click)="decrement()">local decrement</button> Send a <b>local</b> decrement event. This will
only decrement the counter for the current app. <br/>
<button (click)="globalIncrement()">global increment</button> Send a <b>global</b> increment event.
This will increase the counter for the current app and all other apps that listen to this event. <br/>
<button (click)="globalDecrement()">global decrement</button> Send a <b>global</b> decrement event.
This will increase the counter for the current app and all other apps that listen to this event. <br/>
</div>
<br />
<a [routerLink]="['/subroute1']" routerLinkActive="active">Angular route 1</a>
<a [routerLink]="['/subroute2']" routerLinkActive="active">Angular route 2</a>
<router-outlet></router-outlet>
`,
What error are you getting?
You need to use templateUrl instead of template.
Where are you putting the selector in the html?
What does you NgModule look like?
I would like to move the html content into .html file and use the templateUrl instead of template. I am getting 404 error. Can you please help me, am i missing anything?
@Component({ selector: 'app5', template: `
This was rendered by App5 which is written in Angular 6
})