Angular JS is most of the newest technology we are learning these days, By using of angular JS you can do some really fast operation that happens in realtime.
We'll consider an example of making group by of elements if array.
example having schools and it's students, Some name are common and schools are different
$scope.boys= [ {school: 'abc', name: 'Mack'}, {school: 'def', name: 'John'}, {school: 'xyz', name: 'Rihon'},
{school: 'uvw', name: 'John'}, {school: 'jkml', name: 'Rihon'}];
And your HTML will go like this:-
<ul ng-repeat="(key, value) in boys | groupBy: 'name'"> Group name: {{ key }} <li ng-repeat="boys in value"> boys: {{ boys.name }} </li></ul>
Now you'll see the results from the $boys array are now filtered by grouping
Output:-
Group name: Mack
* school: abc
Group name: Rihon
* school: xyz
* school: jkml
Group name: John
* school: def
* school: uvw
And there are still several other features in Angular Js that are really excellent.
1 Comment(s)