Last active
April 21, 2016 07:49
-
-
Save mohamedali-s-4725/3b32763c2445ed1fb0efbe9b785ac670 to your computer and use it in GitHub Desktop.
Revisions
-
mohamedali-s-4725 revised this gist
Apr 20, 2016 . 6 changed files with 33 additions and 12 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 @@ -7,7 +7,8 @@ export default Ember.Component.extend({ actions:{ childAction(){ alert( 'childAction called..' ); var self = this; self.set( 'name', 'childAction' ); } 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 @@ -1,16 +1,16 @@ import Ember from 'ember'; import UpdateMixin from '../mixins/update'; export default Ember.Component.extend(UpdateMixin, { parent_val: 'SMA', actions:{ getValue(){ var self = this; //alert( self.get('parent_val') ); self.send( 'updateVal', self.get('parent_val') ); } } 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 @@ -1,5 +1,6 @@ import Ember from 'ember'; import UpdateMixin from '../mixins/update'; export default Ember.Controller.extend(UpdateMixin, { appName: 'Ember Twiddle' }); 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,17 @@ import Ember from 'ember'; export default Ember.Mixin.create({ updated_val: 'Empty', actions:{ updateVal( value ){alert(value); var self = this; // value = value === undefined ? 'No Value' : value; self.set( 'updated_val', value ); } } }); 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 @@ -1,8 +1,10 @@ <h1>Trigger action between Parent-to-Child Component</h1> <br> <br> {{outlet}} <br> <br> {{dialog-component}} Updated Value from Component: {{ updated_val }} 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 @@ {{ child-component val=parent_val}} <button {{action 'getValue' }}> Update </button> </div> -
mohamedali-s-4725 revised this gist
Apr 20, 2016 . 2 changed files with 4 additions and 2 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 @@ -6,7 +6,8 @@ export default Ember.Component.extend({ actions:{ childAction(){ alert( 'childAction Called..' ); self.set( 'name', 'childAction' ); } 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 @@ -9,7 +9,8 @@ export default Ember.Component.extend({ triggerChildAction(){ var self = this; self.sendAction('childAction'); self.set( 'parent_val', 'parentAction' ); alert( 'parent Action Called..' ) } } -
mohamedali-s-4725 created this gist
Apr 20, 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,15 @@ import Ember from 'ember'; export default Ember.Component.extend({ name: 'Hi', actions:{ childAction(){alert(); self.set( 'name', 'childAction' ); } } }); 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,17 @@ import Ember from 'ember'; export default Ember.Component.extend({ parent_val: 'Hello', actions:{ triggerChildAction(){ var self = this; self.sendAction('childAction'); self.set( 'parent_val', 'parentAction' ); } } }); 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,5 @@ import Ember from 'ember'; export default Ember.Controller.extend({ appName: 'Ember Twiddle' }); 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,11 @@ body { margin: 12px 16px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12pt; } .dialog{ border: solid 1px; width: 300px; height: 100px; } 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,8 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{outlet}} <br> <br> {{dialog-component}} 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 @@ {{input value=(mut val)}} 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 @@ <div class='dialog'> {{ child-component val=parent_val}} <button {{action 'triggerChildAction' }}> Call childAction </button> </div> 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,16 @@ { "version": "0.7.2", "EmberENV": { "FEATURES": {} }, "options": { "use_pods": false, "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.4/ember.debug.js", "ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js", "ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js" } }