The whole codebase relies on items being always defined yet this
contract was broken in v3 release.
I use ngOnChanges since a simple default field value is not enough
in cases where undefined is assigned to GalleryComponent explicitly.
In the test I started using setInput which, unlike simple assignment,
correctly runs ngOnChanges and marks even OnPush component for check.
The default ng's interface for the method is poor however as there is no
keyof Component checking so I provided my own to cover this blind spot.
The whole codebase relies on
items
being always defined yet this contract was broken in v3 release.I use ngOnChanges since a simple default field value is not enough in cases where
undefined
is assigned to GalleryComponent explicitly.In the test I started using
setInput
which, unlike simple assignment, correctly runs ngOnChanges and marks even OnPush component for check. The default ng's interface for the method is poor however as there is nokeyof Component
checking so I provided my own to cover this blind spot.