|
路由配置:
/**
* Created by xumengliang on 15/12/14.
* 路由配置文件
*/
angular.module('app.config',[])
.config(function($stateProvider,$urlRouterProvider){
$stateProvider
.state('home',{
url:'/home',
views:{
'shop-content':
{
templateUrl:"home.html"
}
}
})
.state('home.health',{ //健康
url:'/health',
views:{
'health':
{
templateUrl:"product_list.html",
controller:'healthCtrl'
}
},
})
.state('home.life',{ //生活
url:'/life',
views:{
'health':
{
templateUrl:"product_list.html",
controller:"lifeCtrl"
}
},
})
.state('home.emotion',{ //情感
url:'/emotion',
views:{
'health':
{
templateUrl:"product_list.html",
controller:"emotionCtrl"
}
},
})
.state('home.intrest',{ //兴趣
url:'/intrest',
views:{
'health':
{
templateUrl:"product_list.html",
controller:"intrestCtrl"
}
},
})
.state('productDetail',{
url:'/productDetail/{productId}',
//cache:false,
views:{
'shop-content':
{
templateUrl:"productDetail.html"
}
}
})
.state('order',{
url:'/order',
views:{
'shop-content':
{
templateUrl:"order.html"
}
}
})
.state('editAddress',{
url:'/edit_address/{id}',
views:{
'shop-content':
{
templateUrl:"edit_address.html"
}
}
})
.state('addAddress',{
url:'/add_address',
views:{
'shop-content':
{
templateUrl:"edit_address.html"
}
}
})
.state('editAddressDetail',{
url:'/edit_address_detail',
views:{
'shop-content':
{
templateUrl:"edit_address_detail.html"
}
}
})
.state('managerAddress',{
url:'/manager_address',
views:{
'shop-content':
{
templateUrl:"manager_address.html"
}
}
})
.state('selectAddress',{
url:'/select_address',
views:{
'shop-content':
{
templateUrl:"select_address.html"
}
}
});
$urlRouterProvider.otherwise("/home");
})
.controller ("appCtrl", function($scope,$ionicNavBarDelegate) {
$scope.$on('to-parent', function (event,msg) {
$scope[msg['key']] = msg['value'];
})
});
页面跳转使用$state.go(),或则标签里面 href属性加路径。项目在电脑上浏览器上运行很正常,但是放到iphone6上运行,由时候点击页面跳转,会一下子请求两次页面路径。导致页面会连闪两下。请问各位大神,由有遇到过这个问题的么。 |
|