Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Using Fetched Data With Backbone

window.onload = async function()
{
const Song = Backbone.Model.extend({
defaults:{
  "name": "I love you"
}
})
const Songs = Backbone.Collection.extend({
model: Song
});
const AppView =   Backbone.View.extend({
el: $("#content"),
initialize: function()
{
this.$el.html("<b>"+this.model.get("name")+"</b>");
}
});
var first = new Song();
let r = await test();
let song = new Song(r);
const appView = new AppView({model: song});
 
PREVIOUS NEXT
Tagged: #Using #Fetched #Data #With #Backbone
ADD COMMENT
Topic
Name
6+9 =