I\'m working with Angular. I\'m trying to push an object into an array but it giving me errors. It says that TypeError: Cannot read property \'push\' of undefined
So if it worked for you and as I saw at least few similar questions latly.
If you have TypeError: Cannot read property 'whatever' of undefined
that means you didn't declared some property.
This is declaration:
someProperty: SomeType = []
if you have this its only definition:
someProperty: SomeType
and trying do any operation on it will result in above error.