Show:
Module: ajax
Parent Module: mixins

wrap jquery ajax with Ember.RSVP.Promise, this mixin also has events like:

  • ajaxStart be trigged when ajax request start
  • ajaxDone be trigged when ajax request finish (success or fails)
  • ajaxSuccess be trigged when promise resovle success
  • ajaxError be trigged when ajax request fails
  • RESTSerializerError be trigged error happen when response data serialize

Methods

ajax
(
  • method
  • url
  • options
)
Promise

jquery ajax method wrapper, return promise

Parameters:

Returns:

deleteSerializer
(
  • data
)

delete method response data serializer

Parameters:

Returns:

serializer data

getSerializer
(
  • data
)

get method response data serializer

Parameters:

Returns:

serializer data

postSerializer
(
  • data
)

post method response data serializer

Parameters:

Returns:

serializer data

putSerializer
(
  • data
)

put method response data serializer

Parameters:

Returns:

serializer data

RESTSerializer
(
  • data
)

all ajax response data serializer

Parameters:

Returns:

serializer data

Properties

ajaxSettings

Object

ajax request setting See http://devdocs.io/jquery/jquery.ajax

Default: {dataType: 'json'}

needSerializedMethod

Object

if contentType is application/json which method request data need to be serialized with json

Default: ['post', 'put']

request

Object

wrapper all request method (get put post delete) into request object

Default: {Object}