AngularJS Developer Question:
Download Job Interview Questions and Answers PDF
What is orderby filter?
Answer:
orderby filter orders the array based on provided criteria.
In below example, to order subjects by marks, we've used orderBy marks.
Subject:
<ul>
<li ng-repeat = "subject in student.subjects | orderBy:'marks'">
{{ subject.name + ', marks:' + subject.marks }}
</li>
</ul>
In below example, to order subjects by marks, we've used orderBy marks.
Subject:
<ul>
<li ng-repeat = "subject in student.subjects | orderBy:'marks'">
{{ subject.name + ', marks:' + subject.marks }}
</li>
</ul>
Download AngularJS Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
What is ng-repeat directive? | Tell me how angular.module works? |