MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/angularjs/comments/5h73jb/angular_160_is_released/dboumce/?context=3
r/angularjs • u/abyx • Dec 08 '16
12 comments sorted by
View all comments
7
Keep in mind that $onChanges executes before $onInit. If you assign default values in $onInit you still have to null check in $onChanges.
5 u/celluj34 Dec 09 '16 It's the stupidest issue I've had to deal with. How can your model change before it's initialized? It just doesn't make sense. 1 u/gauiis Dec 27 '16 https://toddmotto.com/angular-1-5-lifecycle-hooks#using-isfirstchange 1 u/celluj34 Dec 27 '16 Nice. Thanks for that! Still seems dumb though, that I have to check in the first place.
5
It's the stupidest issue I've had to deal with. How can your model change before it's initialized? It just doesn't make sense.
1 u/gauiis Dec 27 '16 https://toddmotto.com/angular-1-5-lifecycle-hooks#using-isfirstchange 1 u/celluj34 Dec 27 '16 Nice. Thanks for that! Still seems dumb though, that I have to check in the first place.
1
https://toddmotto.com/angular-1-5-lifecycle-hooks#using-isfirstchange
1 u/celluj34 Dec 27 '16 Nice. Thanks for that! Still seems dumb though, that I have to check in the first place.
Nice. Thanks for that! Still seems dumb though, that I have to check in the first place.
7
u/gabbsmo Dec 08 '16 edited Dec 09 '16
Keep in mind that $onChanges executes before $onInit. If you assign default values in $onInit you still have to null check in $onChanges.