You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
595 B
27 lines
595 B
8 years ago
|
/// <reference path="../../includes.ts"/>
|
||
|
|
||
|
module Configs{
|
||
|
export function removeElementByValue(array:Array<any> ,value:any, key?:string ){
|
||
|
if(key){
|
||
|
for(var i=0; i<array.length; i++){
|
||
|
if(array[i][key] === value){
|
||
|
array.splice(i ,1);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}else{
|
||
|
for(var i=0 ; i<array.length; i++){
|
||
|
if(array[i] === value){
|
||
|
array.splice(i ,1);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export function removeElementsByValue(array: Array<any>, elements:Array<any>){
|
||
|
angular.forEach(elements, (element) =>{
|
||
|
removeElementByValue(array, element.value, element.key);
|
||
|
});
|
||
|
}
|
||
|
}
|