在我的应用程序中,名为responsive
,对于我正在使用matchmedia-ng的控制器,对于模板我使用angular-adaptive-templating
使用此repo与AngularJS版本1.4.1
,
但我收到的错误是:
如何解决?或者只使用matchmedia-ng
本身就可以处理adaptive-templating
。请有人帮我解决这个问题。
提前致谢。
我的Js:
"user strict";
angular.module('responsive', ['ngRoute', 'matchmedia-ng', 'adaptiveTemplating'])
.config(function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when ("/", {
templateUrl : "views/home.html",
controller : "homeController",
reloadOnSearch: false
});
$routeProvider
.otherwise ({
redirectTo:'/',
reloadOnSearch: false
});
});
我的HTML:
<!DOCTYPE html>
<html ng-app="responsive">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>NG - Responsive</title>
<link rel="stylesheet" media="screen and (min-width: 800px)" href="css/desktop.css">
<link rel="stylesheet" media="screen and (max-width: 799px)" href="css/mobile.css">
<!-- lib scripts -->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-route/angular-route.min.js"></script>
<script src="bower_components/angular-adaptive-templating/dist/angular-adaptive-templating.min.js"></script>
<script src="bower_components/matchmedia-ng/matchmedia-ng.js"></script>
<!-- script -->
<script src="js/app.js"></script>
</head>
<body>
<div ng-view ></div>
</body>
</html>
答案 0 :(得分:1)