Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

resolvedView - usage of Container.instance #13

Closed
doktordirk opened this issue Jul 28, 2016 · 0 comments
Closed

resolvedView - usage of Container.instance #13

doktordirk opened this issue Jul 28, 2016 · 0 comments

Comments

@doktordirk
Copy link
Contributor

@bas080 @RWOverdijk

import {Container} from 'aurelia-dependency-injection';
import {ViewManager} from './../view-manager';
import {RelativeViewStrategy, useViewStrategy} from 'aurelia-templating';

export function resolvedView(namespace, view) {
  let viewManager = Container.instance.get(ViewManager);
  let path        = viewManager.resolve(namespace, view);

  return useViewStrategy(new RelativeViewStrategy(path));
}

that's not a good idea. That's only likely to be the same container as used in a SPA. My guess is that it's not when using aurelia-testing. hence to make it proper the code from @Inject would need to be borrowed so that the right container instance will be used

see aurelia/dependency-injection#57

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

No branches or pull requests

1 participant