Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Support of relative "paths" in scatter.load() #28

Open
k7sleeper opened this issue Oct 13, 2014 · 2 comments
Open

Support of relative "paths" in scatter.load() #28

k7sleeper opened this issue Oct 13, 2014 · 2 comments
Labels

Comments

@k7sleeper
Copy link
Contributor

It would be useful if Scatter's load method as well supports relative module "paths" as the module dependency specification already does.

It should be possible to write

scatter.load("./web-server/index").then (web_srv) ->
  web_srv.setUp appConfig.webServer

instead of

mod_ns = ''
i = scatter.module.name.lastIndexOf '/'
if i >= 0
  mod_ns = scatter.module.name[0..i]

... and later ...

scatter.load("#{mod_ns}web-server/index").then (web_srv) ->
  web_srv.setUp appConfig.webServer
@k7sleeper k7sleeper changed the title support of relative "paths" in scatter.load() Support of relative "paths" in scatter.load() Oct 13, 2014
@mariocasciaro
Copy link
Owner

That would be tough because we need a way to know the location from where load() is called. However, if you call load from a container injected as dependency (using container!) it should work.

@k7sleeper
Copy link
Contributor Author

Unfortunately, it's not working!

In the code above scatter is injected using container!.

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

No branches or pull requests

2 participants