正如標題所示,我試圖自學Angular.js,但我遇到了一個意想不到的令人沮喪的路障......我甚至無法讓變量正確顯示在網頁上!角度變量沒有正確顯示在網頁上
<!DOCTYPE html>
<html ng-app>
<head>
<title>Lets test this out?</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
Write your name in the text box!
<input type="text" ng-model="sometext" />
<h1>Hello {{ sometext }}</h1>
</body>
</html>
我會非常感謝任何人都可以告訴我,我在做什麼錯了,因爲我一直在打我的頭靠在我的辦公桌上了一小時,用Google搜索這個問題,但我不明白爲什麼它不」工作。
在您的身體標記中添加** ng-app **。例如'
' – Rostech這是在這裏工作https://plnkr.co/edit/K8zEYdUhiun2qAgQU2Hi?p=preview –