AngularJS component are not updated in the model template, where did I go wrong?

app.component('edit', {
 bindings: {
 password: '='
},
 controller: function (dateFormat,getCurrentManager) {
 this.dateOptions = {
 dateFormat: "yy-mm-dd",
 firstDay: 1
};

 this.when = "";
 this.name = "";
 this.number = "";
 this.flag = false;
 function onDataChange(date){
 var dt = {
 date : dateFormat(date)
};
getCurrentManager(dt).then(function(d){
 this.name = d.data[0].name;
 this.number = d.data[0].number;
});

}
 var secret = "8f1f44ab1c67cfef3f35db355a200444";
 function check() {
 if (md5(this.password) == secret) {
 this.flag = true;
}
}
 function update($http){

}
 this.onDataChange = onDataChange;
 this.check = check;
},
 template: [
'<div>',
 'Enter the password to edit the list of <input type="text" ng-model="$ctrl.password">',
 '<button type="button" ng-click="$ctrl.check()">Edit</button>',
 '<div ng-if="$ctrl.flag">',
 'Enter a number <input class="frm form-control" ui-date="$ctrl.dateOptions" type="text" ng-model="$ctrl.when" ng-change="$ctrl.onDataChange($ctrl.when)">',
 'Enter the number <input class="frm form-control" ng-model="$ctrl.number">',
 'Enter name <input class="frm form-control" type="text" ng-model="$ctrl.name">',
 '<button type="submit" class="btn btn-danger" ng-click="$ctrl.send()">Send data</button> ',
'</div>',
'</div>'
].join(")
});


With the components never worked before. When you invoke onDataChange() from the database factory get the values of name and number, but in view of the value displayed
'Enter the number <input class="frm form-control" ng-model="$ctrl.number">',
 'Enter name <input class="frm form-control" type="text" ng-model="$ctrl.name">',

do not change. Where did I go wrong, I can not understand.
July 8th 19 at 15:48

Find more questions by tags Angular