Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
fix(ng-view): correct infinite loop in RouteProvider injection
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Apr 10, 2014
1 parent 0ebb49f commit be902f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/routing/ng_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ part of angular.routing;
class NgViewDirective implements NgDetachAware, RouteProvider {
static final Module _module = new Module()
..factory(RouteProvider,
(i) => i.get(RouteProvider),
(i) => i.get(NgViewDirective),

This comment has been minimized.

Copy link
@pavelgj

pavelgj Apr 10, 2014

Contributor

I think this change is incorrect... it should probably be

 (i) => i.parent.get(RouteProvider)

This comment has been minimized.

Copy link
@mhevery

mhevery Apr 15, 2014

Author Contributor

It is right. NgViewDirective implements RouteProvider. What this is saying is that if you ask for RouteProvider you will get the NgViewDirective instance. I have @markovuksanovic add test for this.

This comment has been minimized.

Copy link
@pavelgj

pavelgj Apr 16, 2014

Contributor

No, there's also NgBindRouteDirective that "publishTypes" as RouteProvider, and this change would ignore it.

https://github.com/angular/angular.dart/blob/master/lib/routing/ng_bind_route.dart#L36

This comment has been minimized.

Copy link
@mhevery

mhevery Apr 16, 2014

Author Contributor

Here is the original change: 5ec7e83#diff-3b9142529256e2a0be6110e17faf481aL28

NgBindRoute was correctly changed, but NgView was incorrectly changed. So I think this change is correct. In either case this needs to be settled by a test, which I did not know how to write. Could you add it since you are more familiar?

This comment has been minimized.

Copy link
@pavelgj

pavelgj Apr 16, 2014

Contributor

Ahhh... need more coffee...

visibility: NgDirective.CHILDREN_VISIBILITY);
static module() => _module;

Expand Down

0 comments on commit be902f4

Please sign in to comment.