I've been working with angular a lot lately and one thing I wanted to do was use a declared function instead of a place that takes the word "function() {}", like in a promise callback for example. I had a few server requests that, on error, all do the same thing, so instead of saying:
.then(function(data) {
}, function(error) {
});
I wanted to do the following:
.then(function(data) {
}, handleError(error));
function handleError(error) { console.log(error); }
but it wasnt working. Did I make a mistake in how I tried to do this or is this just not possible?
}, handleError.bind(null, error));