AngularJS: Filter example

Some example of angular js filter

by masudcsesust04

HTML

<div id="items" ng-controller="FilterCtrl">
    <div id="fixed">
      {{price}}
    </div>    
</div>

CSS

li {
  height: 120px;
  border-bottom: 1px solid gray;
}

#fixed {
    height: 400px;
    overflow: auto;
}

JavaScript

'use strict'

var myApp = angular.module('myApp', [])

myApp.controller('FilterCtrl', ['$scope', '$filter', function($scope, $filter){        
    // here number is the name of filter
    $scope.price = $filter('number')(1000000);
}]);