var musk = Capitalist.create()
var Franchisee = Capitalist.extend()
Instantiation
Inheritance
Capitalist.reopen({
conscious: true
})
Introspection
var musk = Entrepreneur.create()
var page = Entrepreneur.create()
var bezos = Entrepreneur.create({
location: 'Seattle'
})
var Entrepreneur = Ember.Capitalist.extend(GritMixin, {
foundCompany: function(name){
this.gatherCofounders();
while(!this.get('productMarketFit')){
this.suffer();
this.pivot();
}
this.scale();
this.profit();
}
});
Entrepreneur.foundCompany('uberForScreencasts')
// undefined is not a function!
var musk = Entrepreneur.create({name: 'Elon'});
var tesla = musk.foundCompany('Tesla')
// it works!
(template edition)
{{musk.name}} //=> Elon
{{Entrepreneur.name}} //=> error
var musk = Entrepreneur.create({name: 'Elon'});
//javascript file
export default Ember.Controller.extend({
isEditing: false
})
//handlebars file
{{controller.isEditing}}
init: function(){
this.haveADream();
}
init: function(){
this._super.apply(this, arguments);
this.haveADream();
}
haveADream: function(){
this.goToBed();
this.remSleep();
}.on('init')