Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work for resolves everywhere? #150

Closed
eddiemonge opened this issue Mar 19, 2015 · 1 comment
Closed

Work for resolves everywhere? #150

eddiemonge opened this issue Mar 19, 2015 · 1 comment

Comments

@eddiemonge
Copy link

I have a custom directive that accepts a resolve like ngRoute and ui-router provide but doesn't get annotated

Modal.open 'modal',
  templateUrl: '/templates/sharing.html'
  controller: 'SharingController'
  resolve:
    Permissions: [ 'API', ( API ) ->
      API.query file_id: file.id
    ]
@olov
Copy link
Owner

olov commented Mar 19, 2015

Right, ng-annotate doesn't know about your custom directive so it doesn't annotate it.

You have three options:

  1. (recommended) use ngInject
  2. mimic ui-router API exactly i.e. $modal.open({.. controller: fn, resolve: {f: function($scope) {}, ..}});
  3. write a plugin (but beware that plugin API is experimental and there is not much documentation, see README).

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

No branches or pull requests

2 participants