Skip to content

Instantly share code, notes, and snippets.

View ro0gr's full-sized avatar

Ruslan Hrabovyi ro0gr

  • LigaDigital
  • Kyiv
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@ro0gr
ro0gr / components.my-component.js
Last active November 4, 2018 22:07
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
submit(e) {
e.preventDefault();
}
});
import Ember from 'ember';
export default Ember.Component.extend({
a: Ember.inject.service(),
willDestroyElement() {
setTimeout(() => {
alert(`Component isDestroyed: ${this.isDestroyed}`);
alert(`service.title: ${this.get('a').title}`);
}, 1000)
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@ro0gr
ro0gr / EmberObserver.hbs
Last active June 17, 2018 09:48
Simplified variation on the EmberObserver topic for PO
<div class="AddonSearch">
<form data-test-search>
<label for="addon-search-input">Search For Addons:</label>
<input id="addon-search-input" />
<button>GO</button>
</form>
<ul data-test-addon-list>
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
mouseWheel(e) {
if (document.hasFocus(e.target)) {
e.preventDefault()
}
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@ro0gr
ro0gr / quickstart.md
Created June 11, 2018 18:53
PO: Quickstart
@ro0gr
ro0gr / usage.md
Last active May 14, 2018 21:52
po ideas

Async

We could supply page objects with async is(.*) properties. We need to choose a good prefix for waiting:

// today
await waitUntil(() => loginPage.isVisible);

// vs proposed
await loginPage.untilIsVisible
import Ember from 'ember';
export default Ember.Controller.extend({
router: Ember.inject.service(),
queryParams: ['test'],
test: `I'm changed o_O`,
actions: {