The right syntax to initialize an empty array is

schedule:any=[];
//or schedule: objectType[] =[];

and to add elements
this.schedule.push(yourItem);



Il giorno martedì 16 ottobre 2018 07:33:24 UTC+2, Pathum Lakshan ha scritto:
>
>
> Here i have two array's, 
> schedule: any = {};
> tempschedule: any = {};
>
> and tempschedule array is getting data from dropdowns in the view and it 
> must be append to schedule array after click event. How can i append the 
> data to schedule array, .push method is not working, and i tried with 
> following but it's overwriting the array.
> this.schedule  = Object.assign([], this.tempschedule);
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to