AngularJS ng-model example

by suzo

HTML

<div ng-app="myApp" ng-controller="Ctrl">
    <input type="text" ng-model="message" ng-change="toUpperCase()"/>
    
</div>

JavaScript

angular.module("myApp", [])
	.controller('Ctrl', function ($scope, $timeout){
  	$scope.toUpperCase = function (){
    	$timeout(function (){
      	$scope.message = $scope.message.toUpperCase();
      }, 100)
    	
    }
  });