Skip to main content

Posts

Showing posts with the label how to pass an argument to angularjs custom filter

how to pass an argument to AngularJs Custom Filter

Hi everyone, I am going to share the code sample for how to pass an argument to angularjs custom filter .  The example as give below.  Table of context.                  Click for live demo  1. HTML code sample.  2. AngularJs code sample.  3. Full live demo code sample . 1 2 3 4 5 6 7 //HTML for pass an argument to angularjs custom filter. <div ng-app= "customFilterApp" ng-controller= "customFilterCtrl" >    <p>My name is {{name}}</p>    Sum of Ids is (<span ng-bind= "items | filterSetup:'id'" ></span>) <br>    Sum of Name is (<span ng-bind= "items | filterSetup:'name'" ></span>) </div> //HTML for pass an argument to angularjs custom filter. <div ng-app="customFilterApp" ng-controller="customFilterCtrl"> <p>My name is {{name}}</p> Sum of Ids is (<span ng-bin...