Last active
March 8, 2016 06:04
-
-
Save Gaurav0/1c0da49ac7eab2af3d77 to your computer and use it in GitHub Desktop.
View Stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.Component.extend(App.AddableMixin, { | |
layoutName: 'components/bar-baz', | |
classNames: ['bar-baz'], | |
_createBaz: function() { | |
Ember.run.schedule('afterRender', function() { | |
console.log(this.$().innerHTML); | |
}.bind(this)); | |
}.on('didInsertElement') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BarBazComponent from "components/bar-baz"; | |
export default Ember.Component.extend({ | |
_createBar: function() { | |
BarBazComponent.create({ container: this.get('container')}); | |
}.on('didInsertElement') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.Mixin.create({ | |
_addIt: function() { | |
window.viewStack.push(this); | |
}.on('init') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.6.2", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.1/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.0/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.1/ember-template-compiler.js" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ViewStack from "views/view-stack"; | |
export default Ember.View.extend({ | |
_setup: function() { | |
window.viewStack = ViewStack.create(); | |
}.on('willInsertElement'), | |
_render: function() { | |
window.viewStack.append(); | |
}.on('didInsertElement') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Ember.ContainerView.extend({ | |
push: function(view) { | |
this.pushObject(view); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment