Slide 38
Slide 38 text
THE PAST: BOLTJS
var CarView
=
require('javelin/core').createClass({
name: 'CarView',
extend: require('container').Container,
properties: {
wheels: 4,
},
declare: function() {
return {
childViews: [
{ content: 'I have ' },
{ ref: 'wheelView' },
{ content: ' wheels' }
]
};
},
setWheels: function(wheels) {
this.findRef('wheelView').setContent(wheels);
},
getWheels: function() {
return this.findRef('wheelView').getContent();
},
});
var car
=
new CarView();
car.setWheels(3);
car.placeIn(document.body);
— OUR FIRST 50,000 STARS • CHRISTOPHER CHEDEAU