Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistence across routes #11

Closed
maxbates opened this issue Apr 19, 2014 · 7 comments
Closed

Persistence across routes #11

maxbates opened this issue Apr 19, 2014 · 7 comments

Comments

@maxbates
Copy link

Hotkeys are persisted when declared in controllers, according to your comments because controllers are persisted, but controllers are re-instantiated by ngRoute... it makes sense to persist hotkeys declared in services, but does it really in controllers? Minimally, could you expose an option on the provider to configure whether hotkeys are persisted by default?

@chieffancypants
Copy link
Owner

First of all, that is an excellent sombrero and I applaud your profile picture.

secondly, (and maybe more importantly), I guess I viewed controller defined hotkeys as being persistent because people using them likely aren't using them in conjunction with routes. You raising the issue means this may not be the case. Can you help me with a use-case so I can wrap my brain around such things?

@maxbates
Copy link
Author

My feeling was (could be totally wrong, but at least for people using ngRoute - though don't know what fraction that is anymore) that most controllers are tied to a view, and in most cases that meant instantiated on a route change. I realize that may not be the case for others, but I have built several simple apps around that idea.

I would be happy with a provider config option to not persist them by default...

@ameswarb
Copy link

+1, I feel that if anything persistence should be manually declared

@wmbutler
Copy link

wmbutler commented Jul 9, 2014

+1, I agree. The sombrero rocks. Additionally I agree that it would be nice to exit a route and then have the hotkey continue to work once returning to said route. I was so excited to see that the hotkeys could be defined at the route level. I'm going to wire it up to the controller for now but will switch it out if you decide to add this.

@chieffancypants
Copy link
Owner

Hotkeys defined by routes are not persistent so it sounds like your usecase
will work without modification.

@wmbutler
Copy link

wmbutler commented Jul 9, 2014

Hmmm,

When I first call the route everything works but when I leave the route and
return, it stops working. I solved the problem by binding to scope in the
controller.

On Wed, Jul 9, 2014 at 11:35 AM, Wes Cruver notifications@github.com
wrote:

Hotkeys defined by routes are not persistent so it sounds like your usecase
will work without modification.


Reply to this email directly or view it on GitHub
#11 (comment)
.

Bill Butler
bill@butler.net
(615) 330-5044

@chieffancypants
Copy link
Owner

Sorry for the delay here, I'm trying to clean up old tickets. This scenario is likely possible using the newer bindTo syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants