我的代码: 的index.html角+ require.js:无法实例化模块
<html ng-app='Arrows'>
<script data-main="main" src="require.js"></script>
<div ng-controller="My">
{{status}}
</div>
而main.js文件
require(["jquery","underscore","backbone",
"marionette","angular"], function($ ,_,Backbone,Marionette,angular){
debugger
var app = angular.module("Arrows")
angular.element(document).ready(function() {
angular.bootstrap(document, ['Arrows']);
});
app.controller('My', function($scope) {
$scope.status = 'hello! Its working!';
});
})
我有问题:
Uncaught Error: [$injector:modulerr] Failed to instantiate module Arrows due to: Error: [$injector:nomod] Module 'Arrows' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我添加了angular.module(“箭头”,[]),但结果相同....请帮助我..... ..... – 2014-09-05 07:13:39
添加angular.module(“Arrows”,[] )。 http://plnkr.co/edit/ysdNKDXcHB1BBgXwQcIf?p=preview也许你的问题是使用require,backbone等你使用Angular时真的需要这些框架吗? – knutesten 2014-09-05 10:03:14