我尝试使用独立组件(芯片)而不使用整个lib。由于它依赖于另外两个组件,我也将它们包括在内
angular.module('material.components.chips', [
'material.core',
'material.components.autocomplete'
]);
但我得到了Error: [$injector:nomod] Module 'ngMaterial' is not available!
只有在我包含整个lib之后,这个错误才会消失,我试图避免这种错误。这是HTML脚本:
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-animate.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-aria.js"></script>
<script src="core.js"></script>
<script src="autocomplete.js"></script>
<script src="chips.js"></script>
<script src="app.js"></script>
应用var app = angular.module('myApp', ['ngMaterial']);