1

I have two objects in Angular JS with a same fields:

notifications.fb notifications.tw

How I can merge it and sorted by filed time?

1

1 Answer 1

2

Using angular.extend

angular.extend({}, notifications.fb, notifications.tw);

OR

angular.extend(notifications.fb, notifications.tw);
Sign up to request clarification or add additional context in comments.

5 Comments

Doesn't this override the properties of the destination with those from the source if the objects have the same properties?
@LordTribual no it will merge other..same prop will remains as is
Yes, you are right, if ojbect has same properties for eample time then will be rewrite, but it is not what I need, I need show all items from object. Thanks will try now and will response
@Faud as you asked in question about merging, destination obejct will be shown with the extra field which are not there in destination..basically source & destination get mixed
I dont think so, and I agree to @Faud. If those objects match completly the destination properties with those from the source.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.