I am new to Typescript and Angular 2. I tried to look for an answer in the web but it seems they don't work for me.
Say I have an app.component as shown below:
export class AppComponent{
cartPayableAmount = 0;
........
}
in my app.component.html, the cartPayableAmount is used here
<div> {{cartPayableAmount}} </div>
Now I want to access the cartPayableAmount entity in other class as shown below: So when ever I envoke TestHere() the value for cartPayableAmount will change and it will reflect at the app.component.html.
export class BuyTestComponent {
TestHere() {
// should update cart PayableAmount here.....
cartPayableAmount = "Some value"
}
}
Please help. Thanks