Last active
October 10, 2016 14:06
-
-
Save grapho/8d0f3b5780a278e03781caf07e5999ac to your computer and use it in GitHub Desktop.
progress
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.Component.extend({ | |
progress: Ember.inject.service(), | |
classNames: ['progress-bar'], | |
attributeBindings: ['role'], | |
role: 'progressbar', | |
progressInstance: Ember.computed( | |
'progress.registry.@each.name', | |
'name', | |
function() { | |
let registry = this.get('progress.registry'); | |
let thisName = this.get('name'); | |
return registry.findBy('name', thisName) || null; | |
} | |
), | |
progressPercent: Ember.computed.alias('progressInstance.percent'), | |
progressBarStyle: Ember.computed('progressPercent', function() { | |
let progressPercent = this.get('progressPercent'); | |
return Ember.String.htmlSafe(`width: ${progressPercent}`); | |
}) | |
}); |
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.Controller.extend({ | |
appName: 'Ember Twiddle', | |
progress: Ember.inject.service() | |
}); |
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.Service.extend({ | |
init() { | |
this._super(...arguments); | |
this.registry = []; | |
} | |
}); |
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.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment