<html>
<title> AngularJs Directives </title>
<body>
<div ng-app="" ng-controller="firstController">
Enter subject: <input type="text" ng-model="Subject">
<ol>
<li ng-repeat="item in data | orderBy : 'marks'">
{{ item.Subject + ' marks:' + item.marks }}
</li>
</ol>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
function firstController($scope)
{
$scope.data=[
{
Subject:'English',marks:'40'
},
{
Subject:'Math',marks:'50'
},
{
Subject:'History',marks:'60'
},
{
Subject:'chemistry',marks:'70'
},
{
Subject:'Biology',marks:'45'
}
];
}
</script>
</body>
</html>
<title> AngularJs Directives </title>
<body>
<div ng-app="" ng-controller="firstController">
Enter subject: <input type="text" ng-model="Subject">
<ol>
<li ng-repeat="item in data | orderBy : 'marks'">
{{ item.Subject + ' marks:' + item.marks }}
</li>
</ol>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
function firstController($scope)
{
$scope.data=[
{
Subject:'English',marks:'40'
},
{
Subject:'Math',marks:'50'
},
{
Subject:'History',marks:'60'
},
{
Subject:'chemistry',marks:'70'
},
{
Subject:'Biology',marks:'45'
}
];
}
</script>
</body>
</html>
No comments:
Post a Comment