0

我在 controller.js 中有一个警报功能:

function showAlertFinishedTest() {
var confirmPopup = $ionicPopup.confirm({
    title: 'Finished',
    scope: $scope,
    template: 'Are you sure to submit the result?'
});

confirmPopup.then(function(res) {
    if (res) {
        console.log('Submit file json!');
    } else {
        console.log('Get back to the test!');
    }
});
};

在 if(res){} 中按下提交按钮时如何重定向到另一个模板?

感谢您的所有回答!

4

1 回答 1

0

将 $state 注入控制器并使用$state.go('[your state name]');此处查看 UI 路由器的文档:http: //angular-ui.github.io/ui-router/site/#/api/ui.router.state .$state

于 2016-08-02T10:23:53.860 回答