How can I click or replace a page inside the Navigator Onsen user interface?

I am developing an application with the cordova + Onsen interface. I would like to know how to use the .popPage () method for navigator content. Is it possible? I read, read and read, but did not understand exactly what the navigator meant. I tried to pull all this content from the navigator and placed it in a new page, then I determined the main page of this new one that I created. But did not succeed. Check out the code:

<ons-template id="home.html" style="background:#fff;">
  <ons-navigator var="myNavigator" title="Navigator">

      <ons-page id="content-home" class="fill">
        <div class="gradient">

So, how can I use the push or replace function for the page inside the navigator? Thanks.

+4
source share
1 answer

, ons-button, :

<ons-button modifier="light" ng-click="myNavigator.pushPage('page1.html', { animation : 'slide' } )">
  Push Page
</ons-button>

ons-navigator .

3 :

  • Push-: .
  • -: , , push- .
  • : .

, CodePen

( )

, page, , . , .

- :

<ons-navigator var="myNavigator" page="page1.html"></ons-navigator>

<ons-template id="page1.html">
  <ons-page>
    <ons-button ng-click="myNavigator.pushPage('page1.html');">Push</ons-button>
  </ons-page>
</ons-template>
+4

Source: https://habr.com/ru/post/1611191/


All Articles