Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Backbone Model Setting, Has And Getting

    'use strict';
    var Song = Backbone.Model.extend({
initialize: function(){
console.log("A new song has been created");
}
});
 var song = new Song();
 song.set("title", "Blue in Green");
 console.log(song.has("title"));
 /*true*/
 console.log(song.get("title"));
 /*Blue in Green*/
 console.log(song);
 
PREVIOUS NEXT
Tagged: #Backbone #Model #Has #And #Getting
ADD COMMENT
Topic
Name
2+6 =