Skip to content

Quotes around property names not recognised correctly #205

Open

Description

@steve-price

If I have a directive/service etc that has properties defined in single quotes then it works fine with Angular, but not with the eclipse plugin. The properties do show up in the Angular Explorer but not with and key, just a value

For example, the following does not work correctly, it knows that it exists but for some reason the directive is assumed to be restricted to attributes?

angular.module('app.core').directive('directiveTest', directiveTest);
function directiveTest() {
      return {         
         'restrict': 'E'
      };
}

But, when you remove the single quotes around "restrict" then it is recognised correctly. My understanding was the single quotes around property names was valid?

Activity

  1. angelozerr commented on Jul 26, 2016

    @angelozerr
    Owner

    I think I know how to fix this issue, but using simple quote is it a best practrice?

  2. steve-price commented on Jul 27, 2016

    @steve-price
    Author

    Thanks for the reply.

    I guess an argument for supporting this is not whether it is best practice, but that it is supported by angular, so existing projects that start using this plugin will have this problem if they have been using single quotes as no properties are being read and displayed correctly. In addition to this I noticed that the restriction seems to default to attribute when it cannot read the directive rather than reporting that there is a problem.

    Depending on the size of the project this might be a large number of changes to be able to use the plugin, which I really like by the way, so thanks for all of the work.

    I am interested, just for my personal curiosity, why this might not be best practice?

    Thanks

    Steve

  3. angelozerr commented on Jul 27, 2016

    @angelozerr
    Owner

    I am interested, just for my personal curiosity, why this might not be best practice?

    I'm not a big expert wiatn angular but I say that because:

    If I find time I will try to study if problem comes from acorn, tern or tern-angular1. But very busy for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions