TL;DR Ember added contains
before it was slated for ES7. When the contains
(now includes
) spec did arrive, it was a bit of a problem that Ember was “squatting” the method name with a slightly different implementation. Fortunately, Ember had been designed to “eventually align” with javascript as it becomes more capable. Thus, this was the moment prototype extensions were retired as a default.
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'; | |
import { task, waitForProperty, timeout } from 'ember-concurrency'; | |
const promptTask = task({ | |
answer: undefined, | |
* perform() { | |
yield waitForProperty(this, 'answer', a => a !== undefined); | |
return this.answer; | |
} |
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: '', | |
willDestroyElement() { | |
this.get('model').rollbackAttributes(); | |
} | |
}); |
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
IdP Config Flow | |
SSO Not Installed | |
Click begin setup -> SSO Not Configured | |
SSO Not Configured | |
Submit valid configuration -> SSO Disabled | |
Submit valid configuration with enabled true -> SSO Enabled | |
SSO Enabled | |
Submit enabled false -> SSO Disabled | |
SSO Disabled | |
Submit enabled true -> SSO Enabled |
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', | |
showForm: false | |
}); |
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
// mirage/scenarios/default.js | |
export default function(server) { | |
function store() { | |
let data = server.db.dump(); | |
let json = JSON.stringify(data); | |
localStorage.mirage = json; | |
} |
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 { focus, triggerKeyEvent } from '@ember/test-helpers'; | |
import findButton from './find-button'; | |
import { calculateTabsTo } from './tabbability'; | |
const KEY_RETURN = 13; | |
export default async function keyboardClick(text) { | |
let element = findButton(text); | |
if (!element) { |
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({ | |
items: ['one', 'two', 'three', 'four'], | |
reorderItems(newOrder) { | |
this.set('items', newOrder); | |
}, | |
up(item) { |
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 function add(numbers) { | |
return numbers.reduce((sum, n) => sum + n); | |
} | |
export default Ember.Helper.helper(add); |
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({ | |
changeSomething() { | |
this.set('data', Math.random()); | |
} | |
}); |