Previously we were working on an app with Ionic 1 that had the following structure:
In this app we put crosswalk as the home screen in the index.html. This webview allows us to show the content of our website within the ionic app. Within our website we have a link that redirects us to a specific page of our ionic app. To achieve this, we make a call to the ionic app page that we want to open. We create a button on our website, and insert the path of the page to which we want to go by clicking on the button, in this case the login page was:
<div class="container"> <a href="file:///android_asset/www/index.html#/login" class="button">OPEN LOGIN</a> </div>
Now we want to do the same, but this time using Ionic 2. The structure of the project in Ionic 2 is the next and this has changed and therefore the route where the pages will be located as well:
Image structure ionic 2 project
The button that I used is:
<div class="container"> <a href=" file:///android_asset/src/index.html#/login/login" class="button"> OPEN LOGIN </a> </div>
However, when testing the button, the page (login) of the application that we indicated in the button reference is not opened. We try other combinations:
<div class="container"> <a href=" file:///android_asset/src/index.html#pages/login/login" class="button"> OPEN LOGIN </a> </div>
ó
<div class="container"> <a href=" file:///android_asset/src/index.html#pages/login" class="button"> OPEN LOGIN </a> </div>
ó
<div class="container"> <a href=" file:///android_asset/src/index.html#login" class="button"> OPEN LOGIN </a> </div>
But we did not succeed because it does not do anything when you press the button.
How should the path to be able to open a specific page of an app on ionic 2 from a website?