Skip to content

Support referenced function declaration #57

@toddmotto

Description

@toddmotto

A common pattern a lot of Angular developers I know (myself included) utilise a pattern like this:

function SomeCtrl () {

}
angular
  .module('app', [])
  .controller('SomeCtrl', SomeCtrl);

Currently, to make this work we have to do:

// @ngInject
function SomeCtrl () {

}
angular
  .module('app', [])
  .controller('SomeCtrl', SomeCtrl);

What would the implications be for getting this working with ng-annotate without using an /** @ngInject */ comment? As the method above becomes more popular, I think one of the main downsides to adoption are having to use the comment - is there a way ng-annotate can lookup the function based on it's name based on the scope?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions