Closed magnifi closed 10 years ago
Is that the exact name you are using?
of course not, I have tried auth, auth-interceptor, ... I have tried every other sub-generator, and only decorators seem to have this issue.
Do you have a matching provider? You'll get an error without. Don't remember if it is that error or a different one.
@magnifi Are you still having this issue? Did egger's comment help?
@eddiemonge , Unfortunately it did not, I have to create the decorator manually, and also the exception seems a little bit vague. This is how I produce the issue:
1- Create a provider called auth: yo angular:provider auth 2- Create a service decorator: yo angular:decorator auth-decorator.
The decorator needs to have the same name as the provider. The correct sequence should look like:
yo angular:provider auth
yo angular:decorator auth
@eddiemonge I have tried this first, but it still get the same error. This could be another dependency issue, but I am not sure of that.
Try it again and see if it still happens. If it does, try generating a new project and then running those commands there
OK, I have created a new project and tried the commands. It seems that the issue only appears with CoffeeScript, and works as expected with JS.
here are the commands I have tried:
yo angular:app && yo angular:provider auth && yo angular:decorator auth
however this did not work:
yo angular:app --coffee && yo angular:provider auth && yo angular:decorator auth
I think I have found the issue, it is in the decorator template
angular.module("<%= scriptAppName").config ($provide) ->
it is missing the closing tag.
Thats been fixed in master and will be in the next release
OK, I have seen that.
Thank you.
using the regular command
yo angular:decorator DECORATOR_NAME
throws the following exception: