Angular 1.5 component onChanges is not working

Since we have pretty big Angular 1.x application, we can’t upgrade it fully to Angular 2 but I love the new architecture. Version 1.5 brings amazing components to the old same app. As all cool stuff, it lacks documentation 😉

So, here is a question. I have those two lines in the controller’s definition:

this.$onInit = setType;
this.$onChanges = setType;

the first is working, whilst the second isn’t. I am using '<' binding. So on the first load, the component’s state is set according to passed values, whilst the changes are not being reflected. I got the hope that it should work from [1] and [2].



UPD Ok, I have learnt that it is not supposed to work:

Does anybody know good workarounds?

UPD2 It works as of 1.5.3

107 thoughts on “Angular 1.5 component onChanges is not working”

Leave a Comment