I am a AngularJS beginer.Here is my HTML:
<div class="col-md-12 footer" ng-controller="User">
{{user.username||"ad"}}
</div>
Here is my controllers.js:
angular.controller('User', user);
function User($scope){
$scope.user={
'username':"wang",
'password':"wanghao"
}
}
And I linked the controller in the (I am sure the link is right):
<script src="js/Angular/angular.js"></script>
<script src="js/Angular/controllers.js"></script>
But,when I run my code,here is the result:
{{user.username||"ad"}}
Here is the error: enter image description here I am really confused.I tried to write the JS in the HTML,or link the Javascript before the controller.But it still didn't work!!