Hi there,
I’m woking with this template: https://github.com/monaca-templates/onsenui-v2-angular2-tabbar.
When I incorporate a variable in my class, and try to display this in the .html template with Angular interpolation method {{ var_name }} the variable won’t show.
However, when I also attach a function to an html element, and click this, then suddenly also the var is shown.
My modification to first.ts in the git repo mentioned above:
import {Component} from '@angular/core';
@Component({
selector: 'ons-page[first]',
template: `
<div class="content">
<h4 (click)="test()">Click here</h4>
<p >I am the first tab. {{testvar}}</p>
</div>
`
})
export class First {
testvar = "koen";
constructor() {}
test(){
console.log("test");
}
}
What am I doing wrong? Is there an init method I need to call to make the layout active?
Thanks a lot!
Koen