首先建一個indexApp & its controller
var app = angular.module('indexApp', []);
app.controller('IndexController', ['$scope', function($scope){}]);
再來在網頁上使用ng-app並代入所創建的app值:
<html ng-app="indexApp">
<body ng-controller="IndexController">
</body>
</html>
>>>>> 無法作用
後來改為:
<html ng-app>
<body ng-app="indexApp" ng-controller="IndexController">
</body>
</html>
>>>>> 可以作用
之後再改回去第一個那樣的寫法,卻又可以使用了!!
不知是為何阿....第一次使用不能帶值嗎!?
之後再改回去第一個那樣的寫法,卻又可以使用了!!
不知是為何阿....第一次使用不能帶值嗎!?
// end