<html ng-app>
<head>Angular Model</head>
<body>
<p>
<input ng-model="greeting.text"/>
<p>{{greeting.text}}, AngularJS</p>
</p>
<p ng-controller="HelloAngular">
<p>{{greetingCon.text}}, AngularJS</p>
</p>
</body>
<script src="js/angular.js"></script>
<script src="js/HelloAngular_MVC.js"></script>
</html>
function HelloAngular($scope){
$scope.greetingCon = {
text: 'Hello'
};
}
Try to see if you can get the value
Because your current writing method can run before 1.3.0. If your Angular version is after 1.3.0-beta.15, writing this way will not work.
Here is the official changelog, the description has been selected: https://github.com/angular/an...
Therefore, you need to mount
controller
under amodule
It is also mentioned that you can add
$controllerProvider.allowGlobals();
toconfig
to allow global function, but it is not recommended