Last active
March 9, 2020 16:13
-
-
Save misterbyrne/4213b482b39bf0e7df2147526e7de022 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
export default class MyController extends Controller { | |
appName = 'Ember Twiddle'; | |
@tracked first = 1; | |
@tracked second = 2; | |
@tracked third = 3; | |
@tracked another = 4; | |
@action update() { | |
this.first++; | |
this.second++; | |
this.third++; | |
} | |
get derived() { | |
this.another++; | |
return this.first + this.second; | |
} | |
} |
This file contains 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 MyBaseRoute from 'twiddle/routes/my-base-route'; | |
export default MyBaseRoute.extend({ | |
queryParams: { | |
first: { refreshModel: true }, | |
second: { refreshModel: true }, | |
}, | |
beforeModel() { | |
console.log('beforeModel'); | |
}, | |
async model() { | |
console.log('model'); | |
} | |
}); |
This file contains 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({ | |
mergedProperties: ['queryParams'], | |
queryParams: { | |
third: { refreshModel: true } | |
}, | |
}); |
This file contains 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.16.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.14.3", | |
"ember-template-compiler": "3.14.3", | |
"ember-testing": "3.14.3" | |
}, | |
"addons": { | |
"ember-data": "3.14.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment