android - 转到 ionic 框架中的特定页面

标签 android angularjs cordova ionic-framework

我遇到了一个问题,我必须使用 Controller 在 ionic 框架中打开特定页面。 我必须转到以下页面

#/tab/hotel_details/1

当我在 ionic 弹出窗口中单击确定按钮时

 $scope.showAlert = function() {
   var alertPopup = $ionicPopup.alert({
     title: 'Click OK for further details',
   });
   alertPopup.then(function(res) {
   //Go to a specific page
   });
 };

我不能使用 $state.go("tab.hotel_details"); ,因为我必须去 hotel_details/1 为了进一步开发我的应用程序,我必须摆脱上述问题。

最佳答案

您可以在调用 $state.go 的第二个参数中传递 id :

$state.go("tab.hotel_details", { "id": id })

然后,在您的 Controller 中,您可以从 $stateParams 中检索值:

var id = Number($stateParams.id)

引用:Angular-ui State

关于android - 转到 ionic 框架中的特定页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26467808/

相关文章:

android - 用于在 Android AVD 中测试摄像头的网络摄像头?

angularjs - ng-switch 导致上传错误

android - Xamarin AndroidManifest.xml 与 Visual Studio 中的不同

android - 为什么我从 GCM 服务器端得到 "MismatchSenderId"?

angularjs - Angular 指令四舍五入小数

ios - 在生产模式下在 PhoneGap 上构建 ionic 2/cordova 应用程序

xcode - 在 iOS 上升级到 PhoneGap 2.0 后,JSONKit.m 中出现多个 "Format String Issue"警告

cordova - 使用 localStorage 存储数据的安全性如何?

android - 假的 iOS UI 工具

sql - AngularJS 不会获取由 socket.io 发出的新数据