ComponentProperties no longer in ngOnChanges
See original GitHub issueAfter updating to 10.4.0 we saw a bunch of tests that were suddenly failing. After a bit of digging I realized each component implemented OnChanges
and in the ngOnChanges()
function we were looking for an @Input
property to be in the changes object. It seems with the latest changes any @Input
property that is set in componentProperties
is never in the changes object in ngOnChanges
.
Quick example:
@Component
class Component implements OnChanges {
@Input() someProperty: string
ngOnChanges(changes: SimpleChanges) {
if(changes.someProperty) {
// Do something if @Input property changed
}
}
}
render(Component, {
componentProperties: {someProperty: 'value'}
})
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ngOnChanges not firing for nested object - Stack Overflow
The problem is that ngOnChanges does not fire when rawLapsData changes in the parent. What can I do? import {Component, Input, OnInit, OnChanges,...
Read more >Component initialization without ngOnInit with async pipes for ...
The special case occurs when the component has no inputs at all — in this situation, there is no point for ngOnChanges and...
Read more >Passing route params into angular component's Input ...
ngOnChanges hook is not being triggered when routing params change; the params passed into the component even there is no Input decorator ...
Read more >Change Detection in Angular: Everything You Need to Know
The DOM is updated when the input property changes, even though the change detector reference remains detached. checkNoChanges. This last method ...
Read more >GoJS and Angular -- Northwoods Software
Without this, your styling will not effect the component divs. Read more about Angular view encapsulation here. Your @Component decorator for the component ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@timdeschryver thanks for the quick fix!
Here is my fork with a reproduction test.