Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angularJS$scope.ons.navigator.pushPage不工作_Javascript_Angularjs_Onsen Ui - Fatal编程技术网

Javascript angularJS$scope.ons.navigator.pushPage不工作

Javascript angularJS$scope.ons.navigator.pushPage不工作,javascript,angularjs,onsen-ui,Javascript,Angularjs,Onsen Ui,我使用的是onsen用户界面,我的代码如下 应用程序控制器'AccountsController',函数$scope,$http,AccountsData{ var账户={}; //输出帐户; $scope.Accounts=[]; $http{method:'GET',url:AccountsData.url}。 successfunctiondata、状态、标题、配置{ $scope.Accounts=data.result; }. errorfunctiondata、状态、标题、配置{ }

我使用的是onsen用户界面,我的代码如下

应用程序控制器'AccountsController',函数$scope,$http,AccountsData{ var账户={}; //输出帐户; $scope.Accounts=[]; $http{method:'GET',url:AccountsData.url}。 successfunctiondata、状态、标题、配置{ $scope.Accounts=data.result; }. errorfunctiondata、状态、标题、配置{ }; $scope.viewcount=functionindex{ var selectedItem=$scope.Accounts[index]; AccountsData.selectedItem=selectedItem; alertselectedItem.name; $scope.ons.navigator.pushPage'account.html',选择editem; } $scope.showAcctModal=函数$index{ } }; 账户 添加 -> {{account.name}
问题:当单击列表项account name时,会弹出警报以显示account name,但它不会导航到account.html页面。$scope.ons.navigator.pushPage似乎不起作用,请提供帮助。

如果您使用的是滑动菜单,请尝试以下切换页面:


$scope.ons.slidingMenu.setMainPagehome.html,{closeMenu:true}

您在哪里定义您,在哪里设置$scope.ons.navigator?您是否有另一个控制器是此控制器的父控制器?另外,请告诉您得到了什么JavaScript错误。如果未定义$scope.ons.navigator,则可能会出现这样的错误。好的,我在我的起始页home.html中定义了my,我认为它只需要一次,我错了,在我将添加到当前html文件后,导航器现在可以工作了,感谢您的指出。我没有看到任何javascript错误,我用的是莫纳卡debugger@AndreasArgelius,我仍然有问题,从my home.html,我通过ons.navigator.pushPagexxx.html导航到另一个页面,无论如何,在xxx.html中,我想返回home.html,而不是通过后退按钮,我尝试使用$scope.ons.navigator.pushPagehome.html,但不起作用;我试着在xxx.html周围添加,也不起作用,试着window.history.back,运气不好,你能帮忙吗?使用navigator.popPage返回。导航器维护一个页面堆栈。请阅读Onsen UI文档:。