Convert textBox Value To Uppercase Using Custom Filter

Swappy_Gaj
Posted by Swappy_Gaj under AngularJS category on | Points: 40 | Views : 433
In this Example:
Objective:To convert textbox value to Uppercase using Custom Filter

Code:
1.Create input Textbox
2.Create module
3.Create Controller
4.Create Custom Filter Function
---------------------------------------------
</head>
<body ng-controller="ctrl">
<input type="text" ng-model="nameupper"></input>
{{nameupper|myfilter}}


<script type="text/javascript">

var myapp=angular.module('myapp', []);
myapp.controller('ctrl', function($scope){

});
myapp.filter('myfilter',function()
{

return function(x)
{
var result="";

result=x.toUpperCase();


return result;
}

});
</script>
</body>
</html>

Comments or Responses

Login to post response