Last active
April 13, 2016 23:05
-
-
Save mattmazzola/e81b1a70eb31bc30d85bfd3c152a3043 to your computer and use it in GitHub Desktop.
EmbedTest
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 characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didRender() { | |
if(this.validateAttributes()) { | |
this.embed(this.$()); | |
} | |
}, | |
validateAttributes() { | |
return !Ember.isEmpty(this.get('embedUrl')) && !Ember.isEmpty(this.get('accessToken')); | |
}, | |
embed(element) { | |
const config = { | |
type: 'report', | |
embedUrl: this.get('embedUrl'), | |
accessToken: this.get('accessToken') | |
}; | |
console.log(`embedCalled!`, config); | |
// this.get('embedService').embed(element, config); | |
} | |
}); |
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 characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
report: null, | |
knownReport: { | |
name: 'Known Report', | |
embedUrl: 'http://amazon.com', | |
accessToken: 'fakeToken' | |
}, | |
reports: [ | |
{ name: 'Report 1', embedUrl: 'http://google.com', accessToken: 'fakeToken1' }, | |
{ name: 'Report 2', embedUrl: 'http://bing.com', accessToken: 'fakeToken2' } | |
], | |
actions: { | |
embedReport(report) { | |
this.set('report', report); | |
} | |
} | |
}); |
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 characters
{ | |
"version": "0.7.2", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment