deep merge objects with AngularJS

前端 未结 5 1094
情书的邮戳
情书的邮戳 2020-11-30 07:38

Normally to shallow copy objects I would use angular.extend()

Here\'s an example of that:

var object1 = {
  \"key\": \"abc123def456\",
          


        
5条回答
  •  伪装坚强ぢ
    2020-11-30 07:41

    If you're using < 1.4

    You can use lodash's built in _.merge() that does the same thing as angular > 1.4's version

    Saved me from writing new functions since lodash is pretty popular with angular folks already

提交回复
热议问题