2016-08-11 187 views
2

我試圖通過參考'入門'教程來實現角度材質應用程序。角度材料不起作用

風格

<link href="../node_modules/angular-material/angular-material.css" rel="stylesheet" /> 

腳本

<script src="../node_modules/angular-animate/angular-animate.js" type="text/javascript" ></script> 
<script src="../node_modules/angular-aria/angular-aria.js" type="text/javascript" ></script> 
<script src="../node_modules/angular-material/angular-material.js" type="text/javascript" ></script> 

<script> 
    // Include the dependency upon ngMaterial - important !! 
    angular.module('starterApp', ['ngMaterial']); 
</script> 

我添加使用工具欄按鈕& & <md-toolbar><md-button>下文提到:

<md-toolbar class="md-menu-toolbar"> 
    <div class="md-toolbar-tools"> 
     Toolbar 
    </div> 
</md-toolbar> 
<md-button class="md-fab" aria-label="FAB"> 
    button 
</md-button> 

,但我看到的是沒有棱角材料設計click here.

我錯過了什麼?

+2

你有角庫到頁面? – MarkoCen

+0

是的,我沒有添加角庫 –

+0

,你有沒有在控制檯中的任何錯誤? – MarkoCen

回答

0

這裏是你的問題的答案......

<html lang="en"> 
 
<head> 
 
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css"> 
 
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> 
 
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script> 
 
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script> 
 
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script> 
 
    <script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script> 
 
    <script type="text/javascript"> 
 
     angular.module('starterApp', ['ngMaterial']); 
 
    </script> 
 
</head> 
 
<body ng-app="starterApp" ng-cloak> 
 
<md-toolbar class="md-menu-toolbar"> 
 
    <div class="md-toolbar-tools"> 
 
     Toolbar 
 
    </div> 
 
</md-toolbar> 
 
<md-button class="md-fab" aria-label="FAB"> 
 
    button 
 
</md-button> 
 
</body> 
 
</html>