0
當我在main.js
中添加'ngMaterial', 'ngMessages'
時,我的主頁在保存後變爲空白。在檢查空白頁,我能看到下面的庫和CSS正確加載給定的順序無法在頁面中看到角度實現
的index.html
<link href="assets/css/angular-material.min.css" rel="stylesheet">
<script src="assets/js/lib/angular.min.js"></script>
<script src="assets/js/lib/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-messages/1.5.8/angular-messages.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.js"></script>
<script src="https://gitcdn.link/repo/angular/bower-material/master/angular-material.js"></script>
與CDN
也試過main.js
var app = angular.module(indexModuleName , [
'ngRoute', 'ngMaterial', 'ngMessages'
]);
個
controller.js
app.controller('searchCtrl', function($scope){
$scope.user = {
search: '',
};
});
施加HTML
<md-input-container class="md-block" ng-controller="searchCtrl" >
<input ng-model="user.search" placeholder="Search" ng-required="true">
</md-input-container>
Uncaught Error: [$injector:unpr] Unknown provider: $$asyncCallbackProvider <- $$asyncCallback <- $animate <- $compile
你不也需要包括角的消息JS固定它? – thepio
@thepio它是角詠歎調的一部分,所以不需要添加 –
噢好吧,不知道:) – thepio