Giter Site home page Giter Site logo

Comments (4)

schmod avatar schmod commented on July 21, 2024

👍

Seems reasonable, and shouldn't be terribly difficult to implement. I'll see what I can do.

from babel-plugin-angularjs-annotate.

schmod avatar schmod commented on July 21, 2024

Is there any benefit of being able to individually enable/disable the /* @ngInject */ and 'ngInject' matchers (ie. disable comment-based annotations, but keep prologue-based annotations), or will it be sufficient to add a toggle that disables implicit matches?

from babel-plugin-angularjs-annotate.

mgol avatar mgol commented on July 21, 2024

I think disabling all implicit matches should be enough (at least it would for me); disabling one explicit annotation style is more a job for a linter if someone wants sth like that.

from babel-plugin-angularjs-annotate.

schmod avatar schmod commented on July 21, 2024

While looking at the existing test cases, I stumbled across this:

/* @ngInject */
function MyDirective2($stateProvider) {
    $stateProvider.state('astate', {
        resolve: {
            yoyo: function(ma) {
            },
        }
    });
}

When we're doing "explicit-only" annotating, I think it's reasonable to assume that the above code sample would not work correctly, unless an additional /* @ngInject */ or 'ngInject' was added to yoyo.

When we add an ngInject annotation to a node, I don't think that our users should assume that implicit matching will be enabled for anything inside that node. (Implementing this would be difficult, and IMO, the results could be unpredictable).

I don't really have a question about this... just wanted to write it down somewhere so that it can come back to haunt me later on.

from babel-plugin-angularjs-annotate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.