Javascript 角度js绑定不起作用

Javascript 角度js绑定不起作用,javascript,angularjs,Javascript,Angularjs,我得到了很好的提醒,尽管页面仍然有 if(typeof angular == 'undefined' ) { alert("not working"); } else { alert("good"); } 我错过了什么?我以为装订应该是自动的。 我使用的是AngularJS1.2.16 btw //额外字符,因为stackoverflow不允许我发布问题。代码太多。工作示例: script.js {{Hello World!}} index.html页面: var testApp = ang

我得到了很好的提醒,尽管页面仍然有

if(typeof angular == 'undefined' )
{
alert("not working");
}
else
{
alert("good");
}
我错过了什么?我以为装订应该是自动的。 我使用的是AngularJS1.2.16 btw

//额外字符,因为stackoverflow不允许我发布问题。代码太多。

工作示例:

script.js

{{Hello World!}}
index.html页面:

var testApp = angular.module('MyTestApp', []);

所有包含的脚本都很好。但是,您并没有告诉angular从何处开始引导angular应用程序

html标记上缺少
ng app
指令

<!DOCTYPE html>
<html ng-app="MyTestApp">
<head>

它不应该是angular.module(“LoginApp”,[])?这仍然不起作用。{{}内的任何内容都必须是字符串。这就是错误所在。你所做的其实并不必要。无论如何,谢谢。啊!它必须是一个字符串。完全错过了。谢谢!:)。顺便说一句,我已经给了身体上的ng应用程序指令。所以即使这样,它也应该能工作。在我看来,没有必要总是在html标签上给出它。无论如何,谢谢。:)
<!DOCTYPE html>
<html ng-app="MyTestApp">
<head>
<html ng-app>
{{"Hello World!"}}