Example usage of ic-on-error

45 views
Skip to first unread message

Mark Nellemann

unread,
Nov 21, 2018, 4:39:39 AM11/21/18
to intercooler-js
Hi,

Is it possible to use ic-on-error to present the user w. error-message returned from my backend API in case of errors (non 200 status)?
I would appreciate any examples.


Many thanks,

Mark

Carson Gross

unread,
Nov 26, 2018, 1:50:22 PM11/26/18
to Mark Nellemann, intercooler-js
Hi Mark,

Sure, a really simple example would be:

ic-on-error="alert(str);"

You can write any sort of code you want against the available symbols, which are available here:


Cheers,
Carson
--
You received this message because you are subscribed to the Google Groups "intercooler-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intercooler-j...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Nellemann

unread,
Nov 27, 2018, 7:05:59 AM11/27/18
to intercooler-js
Hi Carson,

Thanks - I got it working;

ic-on-error="alert(xhr.responseText);"


I really enjoy learning and using IntercoolerJS. Thank you for making
it available and continuing the development.


Br,
Mark
Reply all
Reply to author
Forward
0 new messages