0

I'm quite new to Angular js (4 hours of experiance) so I'll be straightforward :
i'm coding the basic examples of an online course, it was recorded in 2014.
The thing is that the function inside the controller is not executing, i know that i'm missing some very basic thing, but i searched for related questions here on StackOverflow and it didn't help, so I'm reling on.
here is the code snippets:

<!DOCTYPE html>
<!-- the index.html file -->
<html ng-app="myApp">
<head>
    <title>Angular Udemy chap 2</title>
    <script src="angular.min.js"></script>
    <script src="app.js"></script>
</head>
<body>
    <div   ng-controlller="mainController">  
        <h1> Hello {{ name }} !!! </h1>
    </div> 
</body> 

/* the app.js file */
var myApp = angular.module('myApp',[]);
myApp.controller('mainController',["$scope",function($scope){
$scope.name = "ElBarto";

}]);
4

1 回答 1

3

你拼错ng-controllerng-controlller。修正错字,一切都应该工作。

于 2016-04-22T20:43:26.553 回答