Ng-App-2

 

In this example of Ng-App, We are going to create custom filter that will convert the message to uppercase. See the example

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="appExample"> <br /> <div class="container" ng-init="msg='LearnKode'"> <label> Name: <input ng-model="msg" /> </label> <br /> <b> {{msg | myUpperFilter}}</b> </div> <script> var app = angular.module("appExample", []); app.filter("myUpperFilter", function () { return function (input) { return input.toUpperCase(); } }) </script> </body> </html>
Output