我使用ionic+material在离子框架中设置材料设计。 我只是运行代码示例中的演示应用程序,但我会收到此错误
模块'ionic-material'不可用!你要么拼错了 模块名称或忘记加载它。如果注册模块,请确保 您将依赖项指定为第二个参数。
这是我的app.js
angular.module('starter', ['ionic', 'starter.controllers','ionic-material','ionMdInput'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href='https://fonts.googleapis.com/css?family=RobotoDraft:400,500,700,400italic' rel='stylesheet' type='text/css'>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="lib/ion-md-input/css/ion-md-input.min.css" rel="stylesheet">
<link href="lib/ionic-material/ionic.material.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic-material/ionic.material.min.js"></script>
<script src="lib/ion-md-input/js/ion-md-input.min.js"></script>
<!-- cordova script (this will be a 404 during development)-->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
答案 0 :(得分:1)
更改示例中ionic.material.min.js
的引用,并使用此link
这适用于 Firefox , Chrome 使用相同的下载文件
答案 1 :(得分:0)
您必须在
中删除离子材料angular.module('starter', ['ionic', 'starter.controllers','ionic-material','ionMdInput'])
您需要将ionicMaterialInk更改为ionic.material.ink 和ionicMaterialMotion。 to ionic.material.motion