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' | |
}); |
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' | |
}); |
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
class AngularController { | |
static injections() { | |
return ['$scope', 'lodash', '$moment', '$timeout']; | |
} | |
static requredInjections() { | |
return ['lodash', '$timeout']; | |
} | |
static getInjections() { | |
let injections = this.injections(); | |
this.requredInjections().map(injectionName => { |
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({ | |
tagName: 'iframe', | |
attributeBindings: ['sandbox','src'], | |
src: Ember.computed(function(){ | |
return ''; | |
}), | |
sandbox: 'allow-scripts allow-same-origin allow-popups allow-top-navigation allow-forms', | |
didRender() { | |
const doc = this.$()[0].contentDocument || this.$()[0].contentWindow.document; |
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
console.log('Starting...'); | |
console.time('Buiding test Data'); | |
const jsonData = {data:new Array(9000000)}; | |
for (let i = 0; i < 9000000; i++) { | |
jsonData.data.push(`el-${i}`); | |
} | |
const dataString = JSON.stringify(jsonData); | |
console.timeEnd('Buiding test Data'); | |
const interval = setInterval(()=>{ | |
console.log(`${Date.now()} - event loop not blocked`); |
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 DS from 'ember-data'; | |
import Ember from 'ember'; | |
const {get, A, isArray} = Ember; | |
export default DS.JSONAPIAdapter.extend({ | |
host: 'http://mysite.com/data', | |
pathMap: { | |
'query:partner-video': 'wm2/get_videos', | |
'query:partner-payment': 'wm2/get_payments', | |
'findAll:partner-video': 'wm2/get_videos', | |
'updateRecord:partner-video': 'wm2/set_file_info', |
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 DS from 'ember-data'; | |
import ClubSerializer from '../serializers/application'; | |
export default ClubSerializer.extend({ | |
extractAttributes(modelClass, resourceHash) { | |
var attributes = {}; | |
resourceHash['origin'] = resourceHash.video_id; | |
resourceHash['file-name'] = resourceHash.file; | |
resourceHash['thumbnail-offset'] = resourceHash.img; | |
resourceHash['duration'] = resourceHash.len_val; |
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
function getArgs(fn) { | |
const str = fn.toString(); | |
return str | |
.slice(str.indexOf('(')+1,str.indexOf(')')) | |
.split(',') | |
.map(e=>e.trim()); | |
}; |
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', | |
a: 1, | |
b: 2, | |
c: 3, | |
d: Ember.computed('a','b','c',function(){ | |
return this.get('a')+this.get('b')+this.get('c'); | |
}) |
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 Twiddle1', | |
a: 3, | |
b: 4, | |
c: 5, | |
d: Ember.computed('a','b','c', function(){ | |
return this.get('a') + this.get('b') + this.get('c'); | |
}), |
OlderNewer