ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 652 forks source link

In ionic serve, if you navigate to a bad url, you can't return #423

Closed cfjedimaster closed 9 years ago

cfjedimaster commented 9 years ago

In the tabs app, I did

g tags/dash

which is a bad url, but I just made a mistake. But at that point, I could no longer navigate back. I tried "r" and "g /" and it didn't work. If I manually fixed the URL and returned, it worked.

jbavari commented 9 years ago

When you're running serve, it's injecting a client side script to interpret those 'go' commands.

Then, when you run the 'go' command (or 'g'), the server sends a message to the client side script to 'go here'.

Once its left that page, the injected client script is no longer running. Thus, the 'go' command wont work anymore.

In this instance, we'd have to detect its not connected anymore. And on the 'reset' or 'go' command after, launch a new window?

What are your thoughts?

cfjedimaster commented 9 years ago

Hmm - a new window would kinda suck I think. But not doing anything is bad too. I guess I'd open a new window too. (I assume you mean tab.)

On Thu, May 14, 2015 at 11:31 PM, Josh Bavari notifications@github.com wrote:

When you're running serve, it's injecting a client side script to interpret those 'go' commands.

Then, when you run the 'go' command (or 'g'), the server sends a message to the client side script to 'go here'.

Once its left that page, the injected client script is no longer running. Thus, the 'go' command wont work anymore.

In this instance, we'd have to detect its not connected anymore. And on the 'reset' or 'go' command after, launch a new window?

What are your thoughts?

— Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic-cli/issues/423#issuecomment-102249992.

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

jbavari commented 9 years ago

Could the users still use the back button on the browser? That way, their client scripts would be reloaded, and they can then use 'go', 'reset', or the other server commands.

The other solution is - on their direction - if its a 404, just direct them back to the home page.

Doing that though, makes it seem like nothing happened. A use case: the user is on the default page, types 'go yahoo.com', they are taken back to the default page. It appears as nothing has happened, when in fact, we just stopped the user from going away from the serve page.

jbavari commented 9 years ago

@cfjedimaster I'm going to close. I haven't had any one report any issues about this as of yet and I can't squeeze out the time to make this happen.

cfjedimaster commented 9 years ago

fair enough!