我正在做一个应用程序,如果应用程序将链接模板正确加载到该状态的侧边菜单项,则单击其中一个侧边菜单。但是该状态的控制器根本没有加载。我尝试调试和检查控制台,但没有。我可以帮忙吗?
这是我为侧边菜单运行的代码:
` <ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="header" animation="nav-title-slide-ios7">
<ion-nav-buttons >
<img class="title" src="logo.png">
</ion-nav-buttons>
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left" id="sideMenuContent">
<ion-header-bar class="bar-stable">
<h1 class="title">Navigation</h1>
</ion-header-bar>
<ion-content>
<ion-list>
</ion-item>
<ion-item nav-clear menu-close ui-sref="app.COE">
<img src="img/aduSampleLogo.png" class="logosample"/>
<b>COE</b>
</ion-item>
<ion-item nav-clear menu-close ui-sref="app.COBA">
<img src="img/aduSampleLogo.png" class="logosample"/>
<b>COBA</b>
</ion-item>
<ion-item nav-clear menu-close ui-sref="CAS">
<img src="img/aduSampleLogo.png" class="logosample"/>
<b>CAS</b>
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
`
这是我的controller.js文件代码:
angular.module('starter.controllers', [])
.controller('homeController', function($scope) {
})
.controller('COEController', function($scope) {
console.log(" COEController is loaded");
}) ;
加上app.js文件:
angular.module('starter',['ionic','angularCircularNavigation','starter.services', 'starter.controllers'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
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('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html"
})
.state('app.home', {
url: "/home",
views: {
'menuContent' :{
templateUrl: "templates/home.html",
controller: "homeController"
}
}
})
.state('app.COE', {
url: '/COE',
views: {
'menuContent' :{
templateUrl: "templates/COE.html",
controller: "COEController"
}
}
}) ;
$urlRouterProvider.otherwise('/app/home');
});
这些是我得到的错误:
Uncaught ReferenceError: rippleExtensionId is not defined
(anonymous function) bootstrap.js:2
(anonymous function) bootstrap.js:2
GET http://localhost:63342/AdvisingAppV3/www/logo.png 404 (Not Found)
(anonymous function) ionic.bundle.js:10615
forEach ionic.bundle.js:7950
forEach.append ionic.bundle.js:10613
JQLite.(anonymous function) ionic.bundle.js:10735
IonicModule.run.factory.getRenderer.enter ionic.bundle.js:39394
updateView ionic.bundle.js:42977
IonicModule.directive.directive.compile.eventHook ionic.bundle.js:42933
$get.Scope.$broadcast ionic.bundle.js:20605
$state.transitionTo.$state.transition.resolved.then.$state.transition ionic.bundle.js:34122
deferred.promise.then.wrappedCallback ionic.bundle.js:19197
(anonymous function) ionic.bundle.js:19283
$get.Scope.$eval ionic.bundle.js:20326
$get.Scope.$digest ionic.bundle.js:20138
$get.Scope.$apply ionic.bundle.js:20430
done ionic.bundle.js:16003
completeRequest ionic.bundle.js:16217
xhr.onreadystatechange ionic.bundle.js:16156