/// module Configs{ export function removeElementByValue(array:Array ,value:any, key?:string ){ if(key){ for(var i=0; i, elements:Array){ angular.forEach(elements, (element) =>{ removeElementByValue(array, element.value, element.key); }); } /** 对象的深拷贝 */ export function deepCopy(object) { var n,i; if (object instanceof Array) { n = []; for (i = 0; i < object.length; ++i) { n[i] = deepCopy(object[i]); } return n; } else if (object instanceof Object) { n = {} for (i in object) { n[i] = deepCopy(object[i]); } return n; } else { return object; } } }