2014-05-10 61 views
0

我圆我的头超过3天为什么发生这种情况

我的身体标记有

<body ng-app="business"> 

这里是我的角码开始

define(['angular'], function(angular) { 
    'use strict'; 
    var app = angular.module('business', []); 
    return app; 
}) 

该代码有时会有效,但大部分时间显示下面的错误。我试图用requirejs

ncaught Error: [$injector:modulerr] Failed to instantiate module business due to: 
Error: [$injector:nomod] Module 'business' 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. 

回答

0

这发生在角未初始化

一下添加到您建立这个app.js:

angular.element(document).ready(function() { 
    angular.bootstrap(document, ['business']); 
}); 

更多信息

Angular Docs
相关问题