This adds uppercase filter to an expression using pipe character. Here, we add uppercase filter to print student name in capital letters.
<html>
<title> AngularJs Directives </title>
<body>
<div ng-app="" ng-controller="firstController">
<ol>
{{ data.fullName() | uppercase}}
</ol>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
function firstController($scope)
{
$scope.data={
firstname:'shekhar',
lastname:'nawale',
fullName:function()
{
var studentObject;
studentObject=$scope.data;
return studentObject.firstname + " " +studentObject.lastname;
}
};
}
</script>
</body>
</html>
<html>
<title> AngularJs Directives </title>
<body>
<div ng-app="" ng-controller="firstController">
<ol>
{{ data.fullName() | uppercase}}
</ol>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
function firstController($scope)
{
$scope.data={
firstname:'shekhar',
lastname:'nawale',
fullName:function()
{
var studentObject;
studentObject=$scope.data;
return studentObject.firstname + " " +studentObject.lastname;
}
};
}
</script>
</body>
</html>
No comments:
Post a Comment