-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cannot set property $inject of function SomeController which has only a getter #53
Comments
it seems that @schmod can you confirm it? |
I was able to fix this by having babel transpile to a lower target. |
The problem in your case that you have already defined You have a few options here:
"plugins": [["angularjs-annotate", { "explicitOnly" : true}]] This way only explicitly annotated classes will be processed check docs: https://www.npmjs.com/package/babel-plugin-angularjs-annotate#explicitonly Because your class doesn't have explicit annotation it will not be processed.
Traspiling to lower target also just "mask" the issue, during transpiling to lower target your getters/setters get transpiled in the way which not causing error during re-assigning read-only property in run-time. |
Hey @zleight1 I am having the same problems so I was wondering what was the target that you set for babel to transpile the code in? Thanks in advance! |
I'm using preset-env and have this browserslist
|
@zleight1 Thank you for the reply. Unfortunately, it did not solve my issue but I will keep trying. Much appreciated. Cheers! |
Hi everyone, I've faced with the issue when using
babel-plugin-angularjs-annotate
plugin v.0.10.0.I've received an error:
SomeController.js
.babelrc
What is wrong in my config?
The text was updated successfully, but these errors were encountered: