Hello,
I am working on an AngularJs typescript application (**AngularJs 1.7.8**). Somehow, a variable is not updated in the template.
My AngularJs component:
export class AppComponent {
// Define our AppComponent's name
static componentName: string = "msApp";
// Define our AppComponent's config
static componentConfig: ng.IComponentOptions = {
bindings: {},
controllerAs: 'vm',
controller: AppComponent,
templateUrl: 'src/components/start-app/start-app.component.html'
};
aParam: string;
searchCallback(param: string) {
this.aParam = param;
}
within the HTML template:
'{{vm.aParam}}'
When the `searchCallback` is invoked, the template doesn't update `vm.aParam`. I suspect it is a change detection issue because if I initialize `aParam` in the controller as follows:
aParam: string = 'foo';
then the template does display 'foo'.
Can someone please help?