Using an array, I am trying to filter and show the unique
information in the list. For that I use the angular
inbuild filter
method.
But I am getting error.
Here is my try (I am filtering by SubProjectName
)
<ul>
<li ng-repeat="project in projectNames | unique: 'SubProjectName' ">
{project.SubProjectName}}
</li>
</ul>
I have updated your plunkr as http://plnkr.co/edit/sx3u1ukH9752oR1Jfx6R?p=preview added filter dependency
Hope this may help you
AngularJS doesn't include a
unique
filter by default. You can use the one from angular-filter. Just include the JavaScriptand include the dependeny in your app:
Your code should work right away! I edited your Plunker so it works.
I think you are looking for an answer like this
Demo
The
unique
filter you are probably attempting to use comes from AngularUI, so you need to include it:and add it as module dependency: