我目前正在将angularjs应用程序转换为离子,angularjs项目包含两个应用程序1.登录应用程序和2.实际应用程序。
在运行离子服务时,首先加载登录应用程序(localhost / login),一旦用户输入凭据,用户将被重定向到具有不同URL(localhost / app)的实际应用程序。
在离子中是否可以使用相同的方案,如果是,有人可以告诉我们如何实现这一目标吗?
答案 0 :(得分:0)
您可以使用$stateProvider
和$urlRouterProvider
检查此https://scotch.io/tutorials/angular-routing-using-ui-router教程
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider
// HOME STATES AND NESTED VIEWS ========================================
.state('home', {
url: '/home',
templateUrl: 'partial-home.html'
})
// ABOUT PAGE AND MULTIPLE NAMED VIEWS =================================
.state('about', {
// we'll get to this in a bit
});
});
https://www.thepolyglotdeveloper.com/2014/11/using-ui-router-navigate-ionicframework/
转发上面的教程