我有我正在尝试在 IONIC 中学习抽象路线。但是我的代码有问题。路线上有错误,但项目结构。有人知道检查吗?
我的文件 ROUTES.JS
angular.module('starter')
.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise("/menu/listagem");
$stateProvider
.state("menu",{
url:"/menu",
templateUrl:'templates/menu.html',
abstract:true,
controller:'listagemController'
})
.state("menu.listagem", {
url: '/listagem',
views:{
'menuContent':{
templateUrl:'templates/listagem.html'
}
}
});ngular.module('starter')
.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise("/menu/listagem");
$stateProvider
.state("menu",{
url:"/menu",
templateUrl:'templates/menu.html',
abstract:true,
controller:'listagemController'
})
.state("menu.listagem", {
url: '/listagem',
views:{
'menuContent':{
templateUrl:'templates/listagem.html'
}
}
});
我的文件 menu.html
<ion-side-menus enable-menu-with-back-views="true">
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-clear button-icon light ion-navicon" menu-toggle="left"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-positive">
<h1 class="title">Menu</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item href="#/menu/home" menu-close>Home</ion-item>
<ion-item href="#/menu/login" menu-close>Login</ion-item>
<ion-item href="" menu-close>Sair</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
我的文件 listagem.html
<ion-view>
<ion-nav-title>Plantas Medicinais</ion-nav-title>
<ion-content>
<h1="title">SUCESS</h1>
</ion-content>
</ion-view>