Open alenkacz opened 13 years ago
Why are you sending pull request with something you think I don't like ? :-D
I can see three ways of doing this:
The third option sounds as the best solution to me, unfortunately, there isn't currently enough flexible form system in angular which would allow us to make it easily... (Misko is working hard on that...)
So I like your decision to do it in $resource, but then, it must be flexible enough...
Your code does not send empty ticket, which is fine, but it allows me to create a project with empty name, that's odd...
$resource service is general purpose service, it knows nothing about tickets neither projects. So we need to add a configuration property, something like "mandatory fields" and then, if any of mandatory field is empty ignore creating...
WRT test, I commented in the commit...
But I am afraid you are not going to like it. Also ... not sure, that this is the right way to test, that resource was not added (and XHR request was not fired)