Get started with backbone.epoxy CDN

MIT licensed

Backbone.Epoxy: JS MVC frame, data binding, event handling.

Tags:
  • backbone
  • plugin
  • model
  • view
  • binding
  • data

Stable version

Copied!

How to start using backbone.epoxy CDN


// Include Backbone and Backbone.Epoxy from CDN
const Backbone = require('backbone');
const Epoxy = require('https://cdn.cdnhub.io/backbone.epoxy/1.3.1/backbone.epoxy.min.js');

// Define your Backbone model
class MyModel extends Backbone.Model {
  constructor() {
    super();
    this.epoxy('apiUrl', 'https://api.example.com/mydata');
  }
}

// Define your Backbone collection
class MyCollection extends Backbone.Collection {
  constructor() {
    super({
      model: MyModel,
      url: 'https://api.example.com/mydata'
    });
  }
}

// Initialize the collection and render the results
const myCollection = new MyCollection();
myCollection.fetch().then(() => {
  // Process the data
  console.log(myCollection.toJSON());
});
Copied!
Copied!
Copied!

All versions