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

remove/reuse existing $inject expressions #8

Open
schmod opened this issue Aug 4, 2016 · 0 comments
Open

remove/reuse existing $inject expressions #8

schmod opened this issue Aug 4, 2016 · 0 comments

Comments

@schmod
Copy link
Owner

schmod commented Aug 4, 2016

The following test-case from the original ng-annotate does not yet pass with the Babel plugin:

Ctrl1.$inject = ["serviceName"];
// @ngInject
// already has .$inject array (before function definition)
function Ctrl1(a) {
}

// @ngInject
// already has .$inject array (after function definition)
function Ctrl2(a) {
}
Ctrl2.$inject = ["serviceName"];

function outer() {
    MyCtrl["$inject"] = ["asdf"];
    return {
        controller: MyCtrl,
    };

    // @ngInject
    function MyCtrl(a) {
    }
}

We need to detect existing $inject statements, and remove and/or correct them. (If there's a conflict, we should probably also print a warning)

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

1 participant