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
const { exec } = require('child_process'); | |
const fs = require('fs'); | |
exec('yarn run lint:hbs', { maxBuffer: 1024 * 10000 }, (_err, stdout) => { | |
const lines = stdout.toString().split(/\r?\n/); | |
const files = lines.filter((line) => line.startsWith('packages/')); | |
for (const file of files) { | |
fs.readFile(file, function (_, fileContent) { | |
const fileLines = fileContent.toString().split(/\r?\n/); |
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 { later } from '@ember/runloop'; | |
import Ember from 'ember'; | |
import { getOwner } from '@ember/application'; | |
import EmberObject, { computed } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
const owner = getOwner(this); |
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'; | |
import { observer, computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
obsCallCount: 0, | |
prop1: computed('prop2', function () { | |
return this.get('prop2') + '123'; | |
}), | |
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
module.exports = { | |
excludes: [ | |
'./dist/**', | |
'./lib/**', | |
'./public/**', | |
'./tmp/**', | |
'./vendor/**', | |
], | |
useRelativePaths: false, | |
groupImports: true, |
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'; | |
const isEven = (item) => item % 2; | |
export default Ember.Controller.extend({ | |
testArray: null, | |
filteredArray: Ember.computed.filter('testArray', isEven), | |
init() { |
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({ | |
}); |
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', | |
test() { | |
return 'foo'; | |
} | |
}); |
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({ | |
baz: '1234', | |
foo: Ember.computed('bar', 'baz', function () { | |
return this.get('bar') + this.get('baz'); | |
}) | |
}); |
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', | |
actions: { | |
bar() { | |
let serv = Ember.getOwner(this).lookup('service:my-service'); | |
console.log(serv); | |
alert(serv.get('test')); |
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({ | |
actions: { | |
test() { | |
this.sendAction('bar', `via action name - ${this.get('output')}`); | |
this.sendAction('foo', `direct - ${this.get('output')}`); | |
} | |
} | |
}); |
NewerOlder