How merge two objects array in angularjs?

前端 未结 4 1479
执念已碎
执念已碎 2021-02-03 22:53

I want to append following object array with existing one in angulajs for implementing load more feature.

ie,appending AJAX response with existing one each time.

<
4条回答
  •  甜味超标
    2021-02-03 23:06

    Simple

    var a=[{a:4}], b=[{b:5}]
    
    angular.merge(a,b) // [{a:4, b:5}]
    

    Tested on angular 1.4.1

提交回复
热议问题