N
N
Nikita Kit2019-05-18 03:00:03
Angular
Nikita Kit, 2019-05-18 03:00:03

Why doesn't angularJs update the template after parent's params change from child event?

I found a curious test for the first angular. At the final stage, I ran into the problem of updating the template.
I tried everything - the angular does not want to in any way. I am not familiar with 1st angular, so I do it naturally, according to the dock, and based on the experience of vue.
Problem areas commented out

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexkhismatulin, 2019-05-18
@ShadowOfCasper

You forgot the link to the controller:

<div>
    Status: {{status ? status : "Waiting..."}}<br>
    Finished: {{myCtrl.finished}}
</div>

Or write the value finishedin scopeinstead of the controller:
$scope.$on('on-finish', (event, endTime, id) => {
  // колбэк отрабатывает, но finished в шаблоне не обновляется
  $scope.$endTime = endTime;
  $scope.finished = status = 'Timer ' + id + ' finished at ' + endTime;
  alert(this.finished);
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question