2014-05-10 60 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
相關問題