Renaud
Renaud

Reputation: 4668

Dependency injection with HTML imports

Having a lot fun with Polymer lately and I was wondering if there was a way I could swap requirejs for HTML imports without achieving namespace pollution. In other words is it possible to do dependency injection with HTML imports?

Upvotes: 3

Views: 151

Answers (1)

svimre
svimre

Reputation: 881

Dependency injection using HTML-imports is possible, but when it comes to namespace pollution you will unfortunately need to address that manually, as all scripts in the HTML5-imports are run in the same scope as the rest of your js code.

Upvotes: 2

Related Questions