question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$injector.invoke calls aren't correctly annotated

See original GitHub issue

The following code which is inside a directive’s link function does not get annotated:

// Compile new element
$injector.invoke(function($compile) {
  $compile(myElement)(scope);
});

Previously posted at mzgol/grunt-ng-annotate#15.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
olovcommented, Jan 9, 2015

@levithomason the annotate-only-when-inside-angular-modules is to reduce the risk of false positives. ngInject to the rescue! Try: $injector.invoke(/*@ngInject*/function($kinvey, ENV) { ... }).

0reactions
levithomasoncommented, Jan 9, 2015

Awesome, still better than manually injecting 😃 Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

$injector - AngularJS: API
Overview. $injector is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.
Read more >
[$injector:strictdi] is not using explicit annotation and cannot ...
angularjs - Error: [$injector:strictdi] is not using explicit annotation and cannot be invoked in strict mode - Stack Overflow. Stack Overflow ...
Read more >
google/guice - Inject Injector does not work with child ... - GitHub
The testcase below works, if the injector is created by: Guice.createInjector(new ChildModule()); it fails if the injector is created by: ...
Read more >
Angulars dependency injection annotation process
First, it calls the toString method on the function - I'm going to recreate the bare basics of this - it won't be...
Read more >
Contexts and Dependency Injection - Quarkus
Quarkus DI solution (also called ArC) is based on the Contexts and ... Bean classes that don't have a bean defining annotation are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found