<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title> Untitled Document </title>
<style>
. red{background:red;}
. yellow{Background:yellow;}
</style>
<script src= "Angular.min.js" ></script>
<script>
/*var m1 = Angular.module (' myApp ', []);
M1.controller (' Aaa ', [' $scope ', function ($scope) {
$scope. Text = ' Hello ';
}]);*/
var m1 = angular.module (' myApp ', []);
M1.controller (' Aaa ', [' $scope ', fnaaa]);
function Fnaaa ($scope) {
}
FnAaa.prototype.num = ' 123 ';
FnAaa.prototype.text = ' Hello ';
FnAaa.prototype.show = function () {
Return ' AngularJS ';
};
</script>
<body>
<!--<div ng-controller= "Aaa" >
<input type= "text" ng-model= "text" ng-model-options= "{updateon: ' Blur '}" >
<div>{{text}}</div>
</div>-->
<div ng-controller= "fnaaa as A1" >
<div>{{a1.text}}:{{a1.show ()}}</div>
</div>
</body>
Binding objects in Ng-controller in Angularjs