I am using legacy angularjs 1.5 with typescript. The data is not getting updated in Active User Card when it changes in parent
Parent
<active-user-card active-users="response.activeUsers"></active-user-card>
Active User Card
export class ActiveUserCard {
activeUsers: number;
data: Array<IChartData>;
constructor() {
........
........
this.inactiveUsers = (totalUsers - this.activeUsers) || 0;
this.data = [
{name: "Active users", y: this.activeUsers},
{name: "Inactive users", y: this.inactiveUsers}
];
........
........
}
}
angular.module('tm')
.directive('activeUserCard', [function() {
return {
restrict: 'E',
scope: {
activeUsers: '<'
},
bindToController: true,
controller: ActiveUserCard,
controllerAs: 'auc',
templateUrl: "./active-user-card.html"
};
}]);