[英]Failed to instantiate module app due to in AngularJS?
I am trying to make an AngularJS app .But I am getting this error: 我正在尝试制作一个AngularJS应用程序,但出现此错误:
Failed to instantiate module app due to
无法实例化模块应用,原因是
Here is my code: 这是我的代码:
<html>
<head><title>New Version!</title>
</head>
<body ng-app="app">
<div ng-controller="appcontr">
<ul>
<li>A new XSLT engine is added: Saxon 9.5 EE, with a namecense (thank you Michael Kay!)</li>
<li>XSLT 3.0 support when using the new Saxon 9.5 EE engine!</li>
<li>Preview your result as HTML when doctype is set to HTML (see this example)</li>
<li>Preview your result as PDF when doctype is set to XML and your document starts with root element of XSL-FO.
Apache FOP is used to generate the PDF
</li>
<li>Added some namenks to useful XSLT sites</li>
</ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js"/>
<script>
angular.module('app', []).controller('appcontr', appcontr)
function appcontr($scope) {
$scope.name = 'dd'
}
</script>
</body>
</html>
It works fine, just close your script reference as follows: 它工作正常,只需关闭脚本引用,如下所示:
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js">
</script>
DEMO DEMO
angular.module('app', []).controller('appcontr', appcontr) function appcontr($scope) { $scope.name = 'dd' }
<html> <head><title>New Version!</title> </head> <body ng-app="app"> <div ng-controller="appcontr"> <h1> {{name}}</h1> <ul> <li>A new XSLT engine is added: Saxon 9.5 EE, with a namecense (thank you Michael Kay!)</li> <li>XSLT 3.0 support when using the new Saxon 9.5 EE engine!</li> <li>Preview your result as HTML when doctype is set to HTML (see this example)</li> <li>Preview your result as PDF when doctype is set to XML and your document starts with root element of XSL-FO. Apache FOP is used to generate the PDF </li> <li>Added some namenks to useful XSLT sites</li> </ul> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js"> </script> </body> </html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.