<!doctype html> <html> <head> <script src="libs/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="myController"> Enter subject<br /> <input type="text" ng-model="subjectName" /><br /> <p>Selected subject name is <span ng-bind="subjectName"></span></p> <ul> <li ng-repeat="subject in student.subjects | filter : subjectName">{{subject.name}}</li> </ul> </div> <script> var app = angular.module("myApp", []); app.controller("myController", function($scope) { $scope.student = { subjects : [{"name" : "English"}, {"name" : "Mathematics"}] }; }); </script> </body> </html>
Friday, June 30, 2017
Using filter filter example in Angular
Subscribe to:
Posts (Atom)
Get Indian financial year based on date
This function lets you get the start and end date of Indian financial year based on given date. This can also be modified for US financia...
-
Add a key "homepage": "your-subfolder/" in your package.json All static files will be loaded from "your-subfold...
-
How to left or right align an element in Bulma Use class .is-pulled-left to left align an element. Use class .is-pulled-right to righ...
-
If you need to show dashed line for a line chart use the below code. < Line type = " linear " dataKey = " trend ...