Last active
July 21, 2016 21:29
-
-
Save patrickberkeley/3901bf2bf11c65cff1b5 to your computer and use it in GitHub Desktop.
Revisions
-
patrickberkeley revised this gist
Feb 5, 2016 . 6 changed files with 28 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ import DS from 'ember-data'; export default DS.FixtureAdapter.extend(); 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,10 @@ export default Ember.Controller.extend({ actions: { toggleInput() { this.toggleProperty('isVisible'); }, submit() { this.get('model').save(); } } }); 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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,6 @@ import Ember from 'ember'; export default Ember.Route.extend({ model() { return this.store.createRecord('my-model'); } }); 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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ {{#if isVisible}} {{input value=model.someProperty insert-newline=(action 'submit') }} {{/if}} 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,21 @@ const { attr } = DS; const MyModel = DS.Model.extend({ someProperty: attr('string') }); MyModel.reopenClass({ FIXTURES: [ { id: 1, someProperty: 'Dickinson' }, { id: 2, someProperty: 'Twain' } ] }); export default MyModel; 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 charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ }, "dependencies": { "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", "ember": "1.13.13", "ember-data": "1.13.15", "ember-template-compiler": "1.13.13" } } -
patrickberkeley created this gist
Feb 5, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ import Ember from 'ember'; export default Ember.Controller.extend({ appName:'Ember Twiddle', isVisible: false, actions: { toggleInput() { this.toggleProperty('isVisible'); } } }); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import Ember from 'ember'; export default Ember.Route.extend({ model() { return this.store.find('my-model'); } }); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{outlet}} <br> <br> <button {{action 'toggleInput'}}> Toggle that input! </button> {{#if isVisible}} {{input value=model.someProperty }} {{/if}} <br> <br> Let's see that model property: <br> {{model.someProperty}} 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ import DS from 'ember-data'; const { attr } = DS; export default DS.Model.extend({ someProperty: attr('string') }); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ { "version": "0.5.0", "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.2.0/ember.debug.js", "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js", "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js" } }