从一个角度应用程序重定向到另一个角度应用程序

时间:2016-08-09 10:31:52

标签: angularjs node.js express ionic-framework

我目前正在将angularjs应用程序转换为离子,angularjs项目包含两个应用程序1.登录应用程序和2.实际应用程序。

在运行离子服务时,首先加载登录应用程序(localhost / login),一旦用户输入凭据,用户将被重定向到具有不同URL(localhost / app)的实际应用程序。

在离子中是否可以使用相同的方案,如果是,有人可以告诉我们如何实现这一目标吗?

1 个答案:

答案 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/

转发上面的教程