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

Quotes around property names not recognised correctly #205

Open
steve-price opened this issue Jul 1, 2016 · 3 comments
Open

Quotes around property names not recognised correctly #205

steve-price opened this issue Jul 1, 2016 · 3 comments

Comments

@steve-price
Copy link

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?

@angelozerr
Copy link
Owner

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

@steve-price
Copy link
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

@angelozerr
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants