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

Resolves behave differently from ngRoute #4

Closed
d6u opened this issue Aug 18, 2013 · 2 comments
Closed

Resolves behave differently from ngRoute #4

d6u opened this issue Aug 18, 2013 · 2 comments

Comments

@d6u
Copy link

d6u commented Aug 18, 2013

Example: http://plnkr.co/edit/5tqVwC

Question 1:

The example showed how redirection in resolve function will affect template and controller. When using route-segment, redirection in before resolve resolved is temporary. Once the resolve finish, original controller and template (OneCtrl and template-one) will be loaded back into <div app-view-segment></div> and keeping url with #/three.

On the other hand, ngRoute will not load OneCtrl and its template back into ng-view after redirection.

Question 2:

The example did not illustrate this problem.

But if I'm using a service name as resolve, the service function will be executed every time I route to that address. Not like in ngRoute, only function resolver will be executed every time, service resolver will only be executed once, which is the right behavior of a service.

Question 3:

Will this module support the new controllerAs syntax?


I really love this nested view module, especially the untilResolve option. Thank you in advance.

@artch
Copy link
Owner

artch commented Aug 18, 2013

  1. Yes, this is known issue. I'm working on it.
  2. Could you please provide a sample for it? Resolving uses $injector.get method which should operate properly regarding singleton caching, etc.
  3. You might use such syntax, it works:
.segment('s1', {
    templateUrl: 'template',
    controller: 'MyCtrl as myCtrl'
})

@d6u
Copy link
Author

d6u commented Aug 18, 2013

Please ignore question 2, it's working now, I must got something wrong.

@artch artch closed this as completed in 2054814 Aug 20, 2013
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

2 participants