// Usage - how to do this simpler? (Because right now it has to be copied to every function) // No custom callback possible also with this implementation FUEL.save(this.form,{ 'c':'user' },ResponseValidator);
function MyCtrl(FUEL, ResponseValidator) {
this.saveFuel = function() {
FUEL.save(this.form,{
'c':'user'
},ResponseValidator);
}
}
--
You received this message because you are subscribed to the Google Groups "angular" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/tQcpbVx7bg4J.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
On 24 August 2011 15:28, Matthias Andrasch
<matthias...@googlemail.com> wrote:
> Where can I trigger the execution of a global success/error-callback? (In
> $xhr or in my resource?)
You cannot create global success/error callbacks for $xhr, but you can
very easily introduce your own, let's call it 'myXhr', service which
will delegate everything to $xhr plus you can add there your global
error/success handlers. More than that: in case "global' is too coarse
grained, you can create yet another 'myYetAnotherXhr' service and use
other error/success callbacks there.
I have not read new $http service yet (to be introduced soon), but
they might have had cooked something nice there to address your
requirements, so have a look at it.
Regards,
Witold Szczerba
Regards,
--
Witold Szczerba
On 30 August 2011 12:17, Matthias Andrasch
> --
> You received this message because you are subscribed to the Google Groups
> "angular" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/bUxjKESPsocJ.