如何在离子框架中将选定的值表单弹出窗口传递给普通控制器页面

时间:2015-09-18 07:38:24

标签: ionic

如何将选定的值表单弹出窗口传递到离子框架中的普通控制器页面

`$scope.showprofpopup = function() 
{
    $scope.data = {}
    var myPopup = $ionicPopup.show
    ({     
        templateUrl: 'templates/popover.html',
        title: 'Please Choose Category',
        scope: $scope,
        buttons: [ { text : 'Cancel' }, { text: 'Select', type: 'button-dark', onTap: function(e) { return $scope.data; } }, ]
    });
    myPopup.then(function(res) 
    {
        //$scope.create(res.category);
        //$state.go('app.userdetails');
        //$scope.contactMessage = { text: res };
        if(!res.category)
        {               
            $ionicLoading.show({ template: '<ion-spinner icon="android"></ion-spinner>', animation: 'fade-in', showBackdrop: true, maxWidth: 100,showDelay: 50 });
            $scope.showprofpopup();
            $timeout(function () { $ionicLoading.hide(); }, 3000);
            //$ionicPopup.alert({ title: "Please Choose Category" });

        }
        else
        {
            $scope.SelectedProfessional = { text: res.category};
            //alert(res.category);
            $state.go('app.userdetails');           
        }
    });
};`

我想将结果re.category发送到app.userdetails页面。有人帮助我。

1 个答案:

答案 0 :(得分:0)

使用$stateParams

 $state.go('app.userdetails',{'category': res.category});