why templateUrl not working in angular 2.when I used template it works .It not work ..here is my code
http://plnkr.co/edit/WI4gK2vbaj4OUX5ImJor?p=preview
import {Component,View} from 'angular2/core';
@Component({
selector: 'my-app',
// template: '<div (click)="onclck()">hello</div>'
})
@View({
templateUrl: 'home/home.html'
});
export class AppComponent {
onclck(){
alert('--')
}
}
You have a semi-colon between @View
decorator and your export class AppComponent
in app/script.ts
. Just remove it and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With