A Pen by Captain Anonymous on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filterDuplicates(arr,key) { | |
const set = new Set(arr.map(x=>x[key])) | |
const newArray = [] | |
while (set.size > 0) { | |
const item = arr.filter(x => set.has(x[key]))[0] | |
set.delete(item[key]) | |
newArray.push(item) | |
} | |
return newArray | |
} |
-
Create a new Angular app by using angular-cli to generate a new project
-
Install angular2-esri-loader
npm install angular2-esri-loader esri-loader --save