1
嗨我是Angular JS的初學者,當我開始創建模塊和控制器時,無法打印我的消息,下面是我的代碼
var myModule = angular.module("myFirst");
myModule.controller = ("cont", function($scope){
$scope.message = "Hi This is my first angular JS Learn ";
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<!DOCTYPE html>
<html ng-app="myFirst">
<head>
<title>This is Angular JS tutorial</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
\t </head>
<body>
<div ng-controller="cont">
{{message}}
</div>
</body>
</html>
感謝
謝謝ÿ ou,但無法得到你在代碼中所做的所有更改。你能區分它嗎?我得到了空注射器 –
@ManjulaD我已經在答案中提到,你可以擴大代碼段並檢查 – Sajeetharan
嘿,謝謝,我明白了.. :) –