Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

fix ngAnnotate use #23

Closed
darcnite3000 opened this issue Feb 23, 2015 · 7 comments
Closed

fix ngAnnotate use #23

darcnite3000 opened this issue Feb 23, 2015 · 7 comments
Labels

Comments

@darcnite3000
Copy link

https://github.com/olov/ng-annotate#explicit-annotations-with-nginject

$futureStateProvider.stateFactory('load',($q, $ocLazyLoad, futureState)=>{
  'ngInject';

  return $q((resolve,reject)=>{
    //code here
  });
});
@amcdnl
Copy link
Contributor

amcdnl commented Feb 23, 2015

Interesting, did not know that.

@amcdnl
Copy link
Contributor

amcdnl commented Feb 27, 2015

this shouldn't be an issue on latest though. Since we manually annotated the items.

@amcdnl amcdnl added the bug label Feb 27, 2015
@lookfirst
Copy link
Contributor

I tried all sorts of variations of that and couldn't get it to work right. =( The one I didn't try was putting the 'ngInject' inside of the method like @darcnite3000 has done, I thought it had to occur above it based on the docs. =(

@lookfirst
Copy link
Contributor

I just tested it and his fix works, but honestly, I don't see it as that much of a stylistic benefit. =( It is far more clear to just write out the injection.

@amcdnl
Copy link
Contributor

amcdnl commented Feb 28, 2015

I agree, don't love the special syntax

@darcnite3000
Copy link
Author

I was mainly showing how it could work without manually annotating.
In the end it comes down to preference.

@amcdnl
Copy link
Contributor

amcdnl commented Mar 3, 2015

@darcnite3000 - absolutely and thanks for the share.

@amcdnl amcdnl closed this as completed Mar 3, 2015
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

3 participants