File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ import Ember from 'ember';
2
2
import fetch from "ember-network/fetch" ;
3
3
import config from '../config/environment' ;
4
4
5
- const SAMPLE_DATA = config . rootURL + 'broccoli-viz-files/initial-build-canary-20161220.json' ;
6
-
7
5
export default Ember . Controller . extend ( {
8
6
init ( ) {
9
7
this . _super ( ...arguments ) ;
@@ -22,8 +20,8 @@ export default Ember.Controller.extend({
22
20
reader . readAsText ( event . target . files [ 0 ] ) ;
23
21
} ,
24
22
25
- useSample ( ) {
26
- fetch ( SAMPLE_DATA )
23
+ useSample ( url ) {
24
+ fetch ( url )
27
25
. then ( ( response ) => {
28
26
return response . json ( ) ;
29
27
} )
Original file line number Diff line number Diff line change 4
4
<input name =" file-upload" type =" file" onchange ={{ action ' parseFile' }} >
5
5
</div >
6
6
<div >
7
- <button {{ action ' useSample' }} >Display sample</button >
7
+ <select onchange ={{ action ' useSample' value =" target.value" }} >
8
+ <option selected disabled>Choose sample file</option >
9
+ <option value =" ./broccoli-viz-files/initial-build-canary-20161220.json" >Empty Project - 2016-12-20</option >
10
+ <option value =" ./broccoli-viz-files/ghost-initial-build-canary-ember-cli-20161222.json" >Ghost Admin Client - 2016-12-22</option >
11
+ </select >
8
12
</div >
9
13
</form >
10
14
You can’t perform that action at this time.
0 commit comments