2015-08-19 162 views
0

我正在尝试角材料工具栏的演示。 js的默认代码没有任何依赖模块。代码看起来像下面角材料问题

angular.module('MyApp') 

.controller('AppCtrl', function($scope) { 

}); 

但是,如果我添加一个新的模块或空方括号像下面,它不工作

angular.module('MyApp',[]) 

.controller('AppCtrl', function($scope) { 

}); 

如果你删除它,它的工作。我如何在不影响材料设计的情况下添加模块?

到plunker的联系是here

+0

你不必在你的[依赖],如[ngMaterial,...]? –

回答

1

您需要ngMaterial添加到您的角度应用程序是这样的:

angular.module('MyApp',['ngMaterial']); 

这里是一个工作​​

+0

但是为什么我在删除',[]'时工作? – robin