刚开始学angular啊,试着写的小demo,就报错了。。。
html:
js:
报错:
------新的报错信息= =#----
按@张伯函 的办法改写了一下 还是报同样的错误
然后我把ng-app="myApp"
报了一个新的错误T^T
业精于勤,荒于嬉;行成于思,毁于随。
Cannot be used directlyfunction来定义controller
function
controller
var myApp = angular.module('myApp',[]); myApp.controller('GreetingController', ['$scope', function($scope) { $scope.greeting = 'Hola!'; }]);
Reference: https://docs.angularjs.org/guide/controller
Holdng-app改成ng-app="myApp"ah, dear
ng-app
ng-app="myApp"
How did the original poster solve the problem? Urgent, waiting online
Cannot be used directly
function
来定义controller
Reference: https://docs.angularjs.org/guide/controller
Hold
ng-app
改成ng-app="myApp"
ah, dearHow did the original poster solve the problem? Urgent, waiting online