1

With respect to question StackOverflow , even I was looking some thing like that only . But it has to eliminate repeating values. Can any one please help me in this.

FOR example $scope.notes=[{"id":"id1", "text":"text1"}, {"id":"id2", "text":"text2"}, {"id":"id2", "text":"text1"}]; This will list all the "text values" from notes JSON data , but it will repeat text1 value twice. Can we make it to display only once.

1 Answer 1

1

Try with this.

 <div ng-model="modelName" ng-repeat="note in notes | unique:'text'">
    <div>{{note.text}}</div>
 </div>
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for the solution. I will try now
Hi .. To use unique , do we need to include angular-filter.min.js in our application
Thank you for your help. Code is working fine. But we have to use angular-filter.min.js. Without this I tried , it didnt work.
@naik3 : If my solution worked for you, you can consider to accept and upvote too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.