Skip to content

Instantly share code, notes, and snippets.

@hikarock
Created May 29, 2013 15:46
Show Gist options
  • Save hikarock/5671325 to your computer and use it in GitHub Desktop.
Save hikarock/5671325 to your computer and use it in GitHub Desktop.
BACKBONE.JSガイドブック1-3
* {
margin: 0;
padding: 0;
border: 0;
}
body {
background: #ddf;
font: 30px sans-serif;
}
<p id='helloWorld'></p>
var Parent = Backbone.View.extend({
i_property: 1,
i_method: function () {
console.log("i");
},
initialize: function() {
console.log("hello!");
},
constructor: function() {
console.log("constructor");
}
}, {
c_property: 2,
c_method: function () {
console.log("c");
}
}
);
console.log(Parent.c_property);
Parent.c_method();
var parent = new Parent;
console.log(parent.i_property);
parent.i_method();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment