Sharing Top Content from the Angular-sphere.

Transformation Functions And Interceptors In AngularJS

  • Transformation functions

    Transforamtion functions are used to format the data before sending the request to the server and after recieveing the response from the server.

  • Transformation functions provides a solution to this problem by reading the data from each Service and transform it into one data format.
  • Angular provides default transformation for the request, response and they can be accessed through $http.default object.
  • Transform Response

    Syntax

    Interceptors are used to modify $http configuration object before the request is sent to the Server and the response object before they are handed over to Application.

  • In this blog, we saw how can we transform the request before sending it to the Server and the response after receiving from the Server, using AngularJS Transformation functions and how can we modify $http configuration object through Interceptors.

This blog will demonstrate the role of Transformation functions and Interceptors in AngularJS.

@perrein: Transformation Functions And Interceptors In AngularJS #Microsoft

Transforamtion functions are used to format the data before sending the request to the server and after recieveing the response from the server. Lets suppose that you are using two different Servces in your Application and the data is coming in the format given below.

After transformation, the propertis are standarized and you can easily manipulate the data. Angular provides default transformation for the request, response and they can be accessed through $http.default object.

Transformation Functions And Interceptors In AngularJS

Comments are closed, but trackbacks and pingbacks are open.