Last active
February 10, 2017 16:37
-
-
Save krivaten/7b02a6bc2b778a4cccb907f0897d0731 to your computer and use it in GitHub Desktop.
Kitten Factory
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| model: null | |
| }); |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| actions: { | |
| renderCustom() { | |
| this.send('showCustomOutlet'); | |
| }, | |
| destroyCustom() { | |
| this.send('destroyCustomOutlet'); | |
| } | |
| } | |
| }); |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| model: null, | |
| componentName: null | |
| }); |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| actions: { | |
| showCustomOutlet() { | |
| console.log('Showing custom'); | |
| // Demo data | |
| let model = [ | |
| { name: 'Hank', description: 'Strange' }, | |
| { name: 'Jessie', description: 'Spikey' }, | |
| { name: 'Walt', description: 'Bald' } | |
| ]; | |
| // Set the component name to render on the custom controller | |
| let controller = 'renderComponent'; | |
| let context = this.controllerFor(controller); | |
| context.set('componentName', 'my-kittens'); | |
| this.render('render-component', { | |
| into: 'application', | |
| outlet: 'custom', | |
| controller, | |
| model | |
| }); | |
| }, | |
| destroyCustomOutlet() { | |
| console.log('Destroying custom'); | |
| this.disconnectOutlet({ | |
| outlet: 'custom', | |
| parentView: 'application' | |
| }); | |
| } | |
| } | |
| }); |
This file contains hidden or 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 url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"); |
This file contains hidden or 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.11.0", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "2.10.2", | |
| "ember-data": "2.11.0", | |
| "ember-template-compiler": "2.10.2", | |
| "ember-testing": "2.10.2" | |
| }, | |
| "addons": {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment