Skip to content

Instantly share code, notes, and snippets.

@gtb104
Created July 3, 2019 16:06
Show Gist options
  • Save gtb104/6531a7b8336689875efa76a3fd31c4e4 to your computer and use it in GitHub Desktop.
Save gtb104/6531a7b8336689875efa76a3fd31c4e4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Service.extend({
const DEFAULT_COUNT = 0;
export default Service.extend({
init() {
this.metaTabCount = DEFAULT_COUNT;
this.recentQueryTabCount = DEFAULT_COUNT;
},
setMetaTabCount(count = DEFAULT_COUNT) {
console.log('updated meta count in service', count);
this.set('metaTabCount', count);
},
setRecentQueryTabCount(count = DEFAULT_COUNT) {
console.log('updated RQ count in service', count);
this.set('recentQueryTabCount', count);
this.notifyPropertyChange('recentQueryTabCount');
},
resetAll() {
this.setMetaTabCount(DEFAULT_COUNT);
this.setRecentQueryTabCount(DEFAULT_COUNT);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": true,
"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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment