Ember CLI IC Ajax

1.0.0 · abandoned · verified Wed Apr 22

The `ember-cli-ic-ajax` package is an Ember CLI addon designed to integrate the `ic-ajax` library into an Ember.js application, making its functionality available within the `vendor.js` build output. `ic-ajax` itself serves as an Ember-friendly wrapper around jQuery's `$.ajax` method, primarily created to provide RSVP promises for asynchronous operations and to simplify AJAX testing through fixture support. This package represents an approach to AJAX management prevalent in earlier Ember ecosystems, preceding the widespread adoption of native `fetch` API or the official `ember-ajax` service (which is now also deprecated in favor of `ember-fetch`). The current stable version, 1.0.0, was released approximately 10 years ago, and both `ember-cli-ic-ajax` and its underlying `ic-ajax` library are no longer actively maintained. Developers should consider modern alternatives like `ember-fetch` for new projects or migrating existing ones, as this package is effectively abandoned.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates fetching data using `ic-ajax`'s `request` method within an Ember component, handling success and error states.

import Component from '@ember/component';
import { action } from '@ember/object';
import { request } from 'ic-ajax';

export default class DataFetcherComponent extends Component {
  message = 'Click button to fetch data';
  data = null;

  @action
  async fetchData() {
    this.set('message', 'Fetching data...');
    try {
      const response = await request('/api/data', {
        method: 'GET',
        dataType: 'json'
      });
      this.set('data', response);
      this.set('message', 'Data fetched successfully!');
    } catch (error) {
      console.error('AJAX Error:', error);
      this.set('message', `Failed to fetch data: ${error.message || error.statusText}`);
    }
  }
}

view raw JSON →