Last active
August 14, 2019 20:41
Revisions
-
EWhite613 revised this gist
Aug 14, 2019 . 1 changed file with 5 additions and 10 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 @@ -22,20 +22,15 @@ queryParams: { } }, _optionsForQueryParam (qp) { const queryParams = get(this, 'queryParams') return get(queryParams, qp.urlKey) || get(queryParams, qp.prop) || queryParams[qp.urlKey] || queryParams[qp.prop] || {} }, model (params) { console.log('witness', params) set(countObj , 'count', countObj.count + 1) return params }, setupController (controller, model) { -
EWhite613 revised this gist
Aug 14, 2019 . No changes.There are no files selected for viewing
-
EWhite613 revised this gist
Aug 14, 2019 . 3 changed files with 20 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 @@ -1,6 +1,6 @@ import Ember from 'ember'; const {get, set} = Ember const countObj = {count: 0} export default Ember.Route.extend({ queryParams: { @@ -21,10 +21,26 @@ queryParams: { as: 'foobar' } }, _optionsForQueryParam (qp) { const result = get(this, `queryParams.${qp.urlKey}`) || get(this, `queryParams.${qp.prop}`) if (!result) { const queryParams = this.queryParams return queryParams[qp.urlKey] || queryParams[qp.prop] || {} } return result }, model (params) { console.log('witness', params) set(countObj , 'count', countObj.count + 1) return params }, setupController (controller, model) { this._super(controller, model) controller.countObj = countObj } }); 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,7 @@ <br> <br> {{nested.foo}} {{countObj.count}} {{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 @@ -16,4 +16,4 @@ "addons": { "ember-data": "3.4.2" } } -
EWhite613 revised this gist
Aug 14, 2019 . 3 changed files with 3 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 @@ -5,7 +5,5 @@ export default Ember.Controller.extend({ nested: { foo: 'bar' }, queryParams: ['nested.foo'] }); 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,7 +4,7 @@ import Ember from 'ember'; export default Ember.Route.extend({ queryParams: { 'nested.foo': { // By default, controller query param properties don't // cause a full transition when they are changed, but // rather only cause the URL to update. Setting 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,7 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{nested.foo}} {{outlet}} <br> <br> -
EWhite613 created this gist
May 14, 2019 .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,11 @@ import Ember from 'ember'; export default Ember.Controller.extend({ appName: 'Ember Twiddle', nested: { foo: 'bar' }, queryParams: [{ foobar: 'nested.foo' }] }); 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,30 @@ import Ember from 'ember'; export default Ember.Route.extend({ queryParams: { 'foobar': { // By default, controller query param properties don't // cause a full transition when they are changed, but // rather only cause the URL to update. Setting // `refreshModel` to true will cause an "in-place" // transition to occur, whereby the model hooks for // this route (and any child routes) will re-fire, allowing // you to reload models (e.g., from the server) using the // updated query param values. refreshModel: true, // By default, the query param URL key is the same name as // the controller property name. Use `as` to specify a // different URL key. as: 'foobar' } }, model (params) { console.log('witness', params) return params } }); 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> {{log model}} {{model.nested.foo}} {{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.1", "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.4.3", "ember-template-compiler": "3.4.3", "ember-testing": "3.4.3" }, "addons": { "ember-data": "3.4.2" } }