Last active
September 20, 2018 08:32
-
-
Save manufitoussi/9dba32465b451f67368b0868e29e7f7f to your computer and use it in GitHub Desktop.
Revisions
-
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 12 additions and 1 deletion.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 @@ -5,7 +5,11 @@ var MyObj = Ember.Object.extend({ get() { var Obj = class Obj { shrinkValues() { Object.keys(this).forEach(key => { if(this[key] === Obj.prototype[key]) { delete this[key]; } }); } }; @@ -34,5 +38,12 @@ export default Ember.Controller.extend({ console.log('this.myObj.obj.prop3', this.myObj.obj.prop3); console.log('this.myObj.obj.prop4', this.myObj.obj.prop4); console.log('this.myObj.obj', this.myObj.obj); Ember.set(this.myObj, 'obj.prop2', 'default2'); this.myObj.obj.shrinkValues(); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); console.log('this.myObj.obj.prop2', this.myObj.obj.prop2); console.log('this.myObj.obj.prop3', this.myObj.obj.prop3); console.log('this.myObj.obj.prop4', this.myObj.obj.prop4); console.log('this.myObj.obj', this.myObj.obj); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 2 additions and 5 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 @@ -4,11 +4,8 @@ var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var Obj = class Obj { shrinkValues() { console.log(Object.keys(this)); } }; -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 8 additions and 8 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 @@ -4,14 +4,14 @@ var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var Obj = class Obj { get(key) { console.log('get()', key); // if(this.hasOwnProperty(key)) return Ember.get(this, key); // return 'coucou'; return Ember.get(this, key) } }; Obj.prototype.prop1 = 'default1'; Obj.prototype.prop2 = 'default2'; Obj.prototype.prop3 = 'default3'; @@ -31,7 +31,7 @@ export default Ember.Controller.extend({ this.myObj = MyObj.create(); this.myObj.obj.prop1 = 1; Ember.set(this.myObj, 'obj.prop2', 2); Ember.set(this, 'myObj.obj.prop3', 3); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); console.log('this.myObj.obj.prop2', this.myObj.obj.prop2); console.log('this.myObj.obj.prop3', this.myObj.obj.prop3); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 6 additions and 3 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 @@ -17,9 +17,7 @@ var MyObj = Ember.Object.extend({ Obj.prototype.prop3 = 'default3'; Obj.prototype.prop4 = 'default4'; return new Obj() } }).readOnly() }); @@ -31,8 +29,13 @@ export default Ember.Controller.extend({ init() { this._super(); this.myObj = MyObj.create(); this.myObj.obj.prop1 = 1; Ember.set(this.myObj, 'obj.prop2', 2); Ember.set(this, 'myObj.obj.prop2', 3); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); console.log('this.myObj.obj.prop2', this.myObj.obj.prop2); console.log('this.myObj.obj.prop3', this.myObj.obj.prop3); console.log('this.myObj.obj.prop4', this.myObj.obj.prop4); console.log('this.myObj.obj', this.myObj.obj); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 2 additions and 1 deletion.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,7 @@ var MyObj = Ember.Object.extend({ }; Obj.prototype.get = function(key) { console.log('get()', key); // if(this.hasOwnProperty(key)) return Ember.get(this, key); // return 'coucou'; return Ember.get(this, key) @@ -33,5 +33,6 @@ export default Ember.Controller.extend({ this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); console.log('this.myObj.obj.prop2', this.myObj.obj.prop2); console.log('this.myObj.obj', this.myObj.obj); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 2 changed files with 2 additions and 1 deletion.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 @@ -32,5 +32,6 @@ export default Ember.Controller.extend({ this._super(); this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); console.log('this.myObj.obj.prop2', this.myObj.obj.prop2); } }); 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,5 +6,5 @@ <br> <div> <label>myObj.obj:</label> {{myObj.obj.prop1}} </div> -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 3 additions and 4 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 @@ -15,12 +15,10 @@ var MyObj = Ember.Object.extend({ Obj.prototype.prop1 = 'default1'; Obj.prototype.prop2 = 'default2'; Obj.prototype.prop3 = 'default3'; Obj.prototype.prop4 = 'default4'; var obj = new Obj(); obj.prop1 = 1; return obj; } }).readOnly() @@ -33,5 +31,6 @@ export default Ember.Controller.extend({ init() { this._super(); this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1', this.myObj.obj.prop1); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 5 additions and 21 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 @@ -1,37 +1,21 @@ import Ember from 'ember'; var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var Obj = class Obj { }; Obj.prototype.get = function(key) { console.log('get(key)', key); // if(this.hasOwnProperty(key)) return Ember.get(this, key); // return 'coucou'; return Ember.get(this, key) }; Obj.prototype.prop1 = 'default1'; Obj.prototype.prop2 = 'default2'; Obj.prototype.prop3 = 'default3'; Obj.prototype.prop4 = 'default4; var obj = new Obj(); obj.prop1 = { -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 15 additions and 16 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 @@ -1,12 +1,25 @@ import Ember from 'ember'; var Value = class Value { constructor() { } get value() { return 'default'; } set value(v) } var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var Obj = class Obj { get prop4() { console.log('get prop4'); return this._prop4; } }; Obj.prototype.get = function(key) { @@ -18,6 +31,7 @@ var MyObj = Ember.Object.extend({ Obj.prototype.prop1 = { value: 'default1' }; Obj.prototype.prop2 = { value: 'default2' }; Obj.prototype.prop3 = { value: 'default3' }; Obj.prototype._prop4 = { value: 'default4' }; var obj = new Obj(); obj.prop1 = { @@ -35,20 +49,5 @@ export default Ember.Controller.extend({ init() { this._super(); this.myObj = MyObj.create(); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 3 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 @@ -11,8 +11,9 @@ var MyObj = Ember.Object.extend({ }; Obj.prototype.get = function(key) { console.log('get(key)', key); // if(this.hasOwnProperty(key)) return Ember.get(this, key); // return 'coucou'; return Ember.get(this, key) }; Obj.prototype.prop1 = { value: 'default1' }; Obj.prototype.prop2 = { value: 'default2' }; -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 5 additions and 5 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 @@ -43,11 +43,11 @@ export default Ember.Controller.extend({ console.log('Ember.get(this, \'myObj.obj.prop2.value\'):', Ember.get(this, 'myObj.obj.prop2.value')); console.log('Ember.get(this.myObj.obj, \'prop2.value\'):', Ember.get(this.myObj.obj, 'prop2.value')); console.log('this.myObj.obj.get(\'prop2.value\'):', this.myObj.obj.get('prop2.value')); this.myObj.obj.prop4.value = 2; console.log('this.myObj.obj.prop4.value:', this.myObj.obj.prop4.value); console.log('Ember.get(this, \'myObj.obj.prop4.value\'):', Ember.get(this, 'myObj.obj.prop4.value')); console.log('Ember.get(this.myObj.obj, \'prop4.value\'):', Ember.get(this.myObj.obj, 'prop4.value')); console.log('this.myObj.obj.get(\'prop4.value\'):', this.myObj.obj.get('prop4.value')); console.log('this.myObj.obj', this.myObj.obj); } }); -
manufitoussi revised this gist
Sep 20, 2018 . No changes.There are no files selected for viewing
-
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 1 addition and 0 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 @@ -5,6 +5,7 @@ var MyObj = Ember.Object.extend({ get() { var Obj = class Obj { get prop4() { console.log('get prop4'); return { value: 'default4'}; } }; -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 29 additions and 11 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 @@ -3,18 +3,25 @@ import Ember from 'ember'; var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var Obj = class Obj { get prop4() { return { value: 'default4'}; } }; Obj.prototype.get = function(key) { console.log('get(key)', key); if(this.hasOwnProperty(key)) return Ember.get(this, key); return 'coucou'; }; Obj.prototype.prop1 = { value: 'default1' }; Obj.prototype.prop2 = { value: 'default2' }; Obj.prototype.prop3 = { value: 'default3' }; var obj = new Obj(); obj.prop1 = { value: 1 }; return obj; } }).readOnly() }); @@ -28,7 +35,18 @@ export default Ember.Controller.extend({ this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value); console.log('Ember.get(this, \'myObj.obj.prop1.value\'):', Ember.get(this, 'myObj.obj.prop1.value')); console.log('Ember.get(this.myObj.obj, \'prop1.value\'):', Ember.get(this.myObj.obj, 'prop1.value')); console.log('this.myObj.obj.get(\'prop1.value\'):', this.myObj.obj.get('prop1.value')); console.log('this.myObj.obj', this.myObj.obj); console.log('this.myObj.obj.prop2.value:', this.myObj.obj.prop2.value); console.log('Ember.get(this, \'myObj.obj.prop2.value\'):', Ember.get(this, 'myObj.obj.prop2.value')); console.log('Ember.get(this.myObj.obj, \'prop2.value\'):', Ember.get(this.myObj.obj, 'prop2.value')); console.log('this.myObj.obj.get(\'prop2.value\'):', this.myObj.obj.get('prop2.value')); this.myObj.obj.prop2.value = 2; console.log('this.myObj.obj.prop2.value:', this.myObj.obj.prop2.value); console.log('Ember.get(this, \'myObj.obj.prop2.value\'):', Ember.get(this, 'myObj.obj.prop2.value')); console.log('Ember.get(this.myObj.obj, \'prop2.value\'):', Ember.get(this.myObj.obj, 'prop2.value')); console.log('this.myObj.obj.get(\'prop2.value\'):', this.myObj.obj.get('prop2.value')); console.log('this.myObj.obj', this.myObj.obj); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 3 additions and 1 deletion.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 @@ -13,6 +13,8 @@ var MyObj = Ember.Object.extend({ return 'coucou'; } }; return obs; } }).readOnly() }); @@ -27,6 +29,6 @@ export default Ember.Controller.extend({ console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value); console.log('Ember.get(this, \'myObj.obj.prop1.value\'):', Ember.get(this, 'myObj.obj.prop1.value')); console.log('Ember.get(this.myObj.obj.prop1, \'value\'):', Ember.get(this.myObj.obj.prop1, 'value')); console.log('this.myObj.obj.get(\'prop1.value\'):', this.myObj.obj.get('prop1.value')); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 8 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 @@ -3,14 +3,15 @@ import Ember from 'ember'; var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { var obj = { prop1: { value: 1, }, get(key) { if(obj.hasOwnProperty(key)) return Ember.get(obj, key); return 'coucou'; } }; } }).readOnly() @@ -24,7 +25,8 @@ export default Ember.Controller.extend({ this._super(); this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value); console.log('Ember.get(this, \'myObj.obj.prop1.value\'):', Ember.get(this, 'myObj.obj.prop1.value')); console.log('Ember.get(this.myObj.obj.prop1, \'value\'):', Ember.get(this.myObj.obj.prop1, 'value')); console.log('this.myObj.obj.prop1.get(\'value\'):', this.myObj.obj.prop1.get('value')); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 2 additions and 0 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 @@ -24,5 +24,7 @@ export default Ember.Controller.extend({ this._super(); this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value); console.log('this.get(\'myObj.obj.prop1.value\'):', this.get('myObj.obj.prop1.value')); console.log('this.myObj.get(\'obj.prop1.value\'):', this.myObj.get('obj.prop1.value')); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 6 additions and 1 deletion.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 @@ -5,7 +5,11 @@ var MyObj = Ember.Object.extend({ get() { return { prop1: { value: 1, get(key) { return 'coucou'; } } }; } @@ -19,5 +23,6 @@ export default Ember.Controller.extend({ init() { this._super(); this.myObj = MyObj.create(); console.log('this.myObj.obj.prop1.value:', this.myObj.obj.prop1.value); } }); -
manufitoussi revised this gist
Sep 20, 2018 . 1 changed file with 1 addition and 1 deletion.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,5 +6,5 @@ <br> <div> <label>myObj.obj:</label> {{myObj.obj.prop1.value}} </div> -
manufitoussi revised this gist
Sep 20, 2018 . 2 changed files with 6 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 @@ -18,6 +18,6 @@ export default Ember.Controller.extend({ init() { this._super(); this.myObj = MyObj.create(); } }); 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 @@ -3,4 +3,8 @@ <br> {{outlet}} <br> <br> <div> <label>myObj.obj:</label> {{myObj.obj}} </div> -
manufitoussi created this gist
Sep 20, 2018 .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,23 @@ import Ember from 'ember'; var MyObj = Ember.Object.extend({ obj: Ember.computed({ get() { return { prop1: { value: 1 } }; } }).readOnly() }); export default Ember.Controller.extend({ appName: 'Ember Twiddle', init() { this._super(); this.myObj = obj; } }); 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,6 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{outlet}} <br> <br> 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,19 @@ { "version": "0.15.0", "EmberENV": { "FEATURES": {} }, "options": { "use_pods": false, "enable-testing": false }, "dependencies": { "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", "ember": "3.2.2", "ember-template-compiler": "3.2.2", "ember-testing": "3.2.2" }, "addons": { "ember-data": "3.2.0" } }