drew
drew

Reputation: 105

Onsen UI myNavigator.pushPage() not working in modal

I am trying to move the user from a modal to a new page but it doesnt work Onsen UI v 1.3.8

If I use ng-click="myNavigator.pushPage('signup.html');" on any modal, it doesnt successfully change the page, it doesnt do anything and gives no error message in console or in the UI.

<ons-modal var="modalsignup" ng-controller="RegisterController">
   <ons-page>
    <ons-row style="padding-top:5em;">
        <ons-col>
              <div class="formarea">

                <a href="" ng-click="myNavigator.pushPage('signup.html');">Sign Up</a>
                <div class="form-row">
                  <input type="text" class="text-input--underbar width-full" placeholder="Email" id= "email" ng-model="email">
                </div>

                <div class="form-row">
                  <input type="password" class="text-input--underbar width-full" id="password" placeholder="Password" ng-model = "password" value="">
                </div>

              </div>
      </ons-col>
    </ons-row>        
   </ons-page>
</ons-modal>

Any ideas how to solve this?

Upvotes: 0

Views: 191

Answers (1)

Ilia Yatchev
Ilia Yatchev

Reputation: 1262

Did you check what exactly seems to be happening?

If there was no error then maybe the page was pushed normally, but your problem lies elsewhere. For example if your modal is outside your navigator or the current page, since it's a modal it may be visible and hiding the navigator itself. In that case your options are:

  • Hide the modal manually
  • Make sure that it's inside the current page

If neither of these work then you would need to provide some more information after looking into the problem yourself. If you just say X is not working it's hard for anyone to help you unless he can reproduce the problem. Just with your information I am unable to reproduce your problem.

I have made a small Demo with your signup form. You can see that there it works fine.

In order for other people to be able to help you more easily you could:

  • look around by yourself and try to provide some more info. The way which you're stating your problem it doesn't sound like you checked the contents of the ons-navigator in the elements tab of the browser inspector.
  • make a codepen where the bug is shown - that way anyone will be able to see the problem at hand. For example if you can modify mine to reproduce the bug it will be easy to debug.

Upvotes: 2

Related Questions