Category: programming

  • Angular’s $http.error()

    Earlier I promised (ha! PROMISE!) to explain why I don’t like Angular’s $http.success() and .error() but this guy beat me to the punch: Don’t use $http’s .success() First, I hate anything that creates inconsistency in my code. If we use success() we’ll still have to use then() in every other place that has a promise, […]

  • RESTful responses and Angular

    Testing for an empty JSON document I have a RESTful service that performs a search and returns the results as JSON, and if there’s no results I return an empty document, {}. Now I don’t know what the original author’s situation is or how much control they have over the API they’re consuming, but I […]