Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

widget compile function is not injected and gets the element twice #670

Closed
esprehn opened this issue Nov 23, 2011 · 2 comments
Closed

widget compile function is not injected and gets the element twice #670

esprehn opened this issue Nov 23, 2011 · 2 comments

Comments

@esprehn
Copy link
Contributor

esprehn commented Nov 23, 2011

angular.widget('example', function(compileElement1,compileElement2) {
  assert(compileElement1 == compileElement2); // ???
  return function(instanceElement) {
    // ...
  };
}, {$inject: ['$defer']});

The $inject doesn't do anything here like it would on services, and the compile function has two arguments and both are the jquery wrapped element.

It's lame to need to use the angular.extend trick to get injection in the instance function.

@mhevery
Copy link
Contributor

mhevery commented Nov 23, 2011

Funny, you file a bug, since I am working on this right this moment. :-)

@IgorMinar
Copy link
Contributor

the injection issue is fixed in the head with the new injector. previously it was not possible to inject compile functions because the scope and with it the injector were created only after compilation before linking.

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

3 participants