您好我似乎总是遇到这个问题,新项目需要我几天才能让路由正常工作然后突然之间就可以了。我觉得可能是缓存问题,但我似乎无法解决最简单的初学者项目。
例如离子启动器模板一旦我更改为新的ng-app并使用新的staeprovider创建一个新的app.js文件就会变成白色屏幕?似乎无论我做什么,一旦我将启动器更改为eliteApp,例如没有任何作用。
任何有用的帮助
app.js
angular.module('eliteApp', ['ionic']).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();
}
});
})
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider.state('home', {
url: '/home',
abstract: true,
templateUrl: 'app/home/home.html',
// controller: 'AppCtrl'
});
$urlRouterProvider.otherwise('/home');
});
的index.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="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!--For users deploying their apps to Windows 8.1 or Android Gingerbread, platformOverrided.js
will inject platform-specific code from the /merges folder -->
<script src="js/platformOverrides.js"></script>
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/notapp.js"></script>
<!--<script src="js/controllers.js"></script>-->
</head>
<body ng-app="eliteApp">
<ion-nav-view></ion-nav-view>
</body>
</html>