Cannot read property 'push' of undefined(…) in angular2
publicDeals
is not initiated;
publicDeals: Deal[] = [];
you have to initialize array using below:
publicDeals: Deal[] = [];
or
publicDeals: Deal[] = new Array();
Here goes the number array:
items : number[ ] = [ ];
If you use AngularFire5.0 Before pushing you must list your items
const afList = afDb.list('items');
afList.push({ name: 'item' });
you should see the update of Angularfire 5.0 here