0

I am using Angular JS with Onsen UI framework. In any template to "change page" I just need to put an ng-click calling the function:

ons.screen.presentPage('mypage.html')

I need to do the same into a controller (javascript code), in other words I want to change page without clicking on links.

Thanks

Danilo Paone
  • 148
  • 1
  • 2
  • 9

2 Answers2

1

To call any function defined into the Screen Service I just needed to add $rootScope before ons.screen.presentPage('mypage.html').

$rootScope.ons.screen.presentPage('mypage.html')
Danilo Paone
  • 148
  • 1
  • 2
  • 9
0

Call the function normally, as you would do outside ng-click. If you did load onsenui.js, it shall work seamlessly.

André Luiz
  • 193
  • 2
  • 10