Please can you help? Just starting with Angular 2 and having the following issue.
My component is below:
@Component({
selector: 'myapp',
inputs: ['mynumber']
})
@View({
template: `<p>The next number is {{ mynumber + 1 }}</p>'
})
export class App {
mynumber: number;
}
bootstrap(App);
Inside my HTML:
<myapp [mynumber]='41'></myapp>
But when run I get the following:
The next number is NaN
It looks simple but I am missing something. What I am trying to achieve is passing a value from outside the app into it.
Thanks.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…