Skip to content

Instantly share code, notes, and snippets.

View lolmaus's full-sized avatar
🧠
Reducing entropy

Andrey Mikhaylov (lolmaus) lolmaus

🧠
Reducing entropy
View GitHub Profile
import Controller from '@ember/controller';
import { TrackedArray } from 'tracked-built-ins';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'particial application';
values = new TrackedArray([0, 1, 2, 3, 4, 'omg']);
@action handleInput(event) {
this.values[0] = event.target.value;
import Controller from '@ember/controller';
import { alias } from '@ember/object/computed';
import EmberObject, { computed } from '@ember/object';
import { A } from '@ember/array';
const AttributeModel = EmberObject.extend({
countAdditives: alias('additives.length'),
additives: A()
});
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class extends Component {
@tracked value = 'test';
@tracked counter = 0;
@action submit(e) {
if (e.key === 'Enter') {
@lolmaus
lolmaus / controllers.application.js
Created September 26, 2018 14:46 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
import Ember from 'ember';
export default Ember.Controller.extend({
});
@lolmaus
lolmaus / components.input-wrapper.js
Created August 22, 2018 10:55
wrapped input update
import Ember from 'ember';
export default Ember.Component.extend({
});
import TooltipsterComponent from 'ember-cli-tooltipster/components/tool-tipster';
import { computed } from '@ember/object';
export default TooltipsterComponent.extend({
// define properties
content: 'test',
contentAsHTML: true,
});
import Ember from 'ember';
import RSVP from 'rsvp';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
Ember.onerror = (error) => {
alert(error.message)
// Datepicker template
{{#basic-dropdown
renderInPlace=false
matchTriggerWidth=false
as |dropdown|}}
<input type="text"
data-ebd-id="{{dropdown.uniqueId}}-trigger"
placeholder="Date range"
class="fw-datepicker"
@lolmaus
lolmaus / components.the-item.js
Last active November 15, 2017 08:12 — forked from lolmaus1/components.the-item.js
ember-drag-sort with Ember Data and rowOrder
import Ember from 'ember'
export default Ember.Component.extend({
classNames: ['the-item'],
})
@lolmaus
lolmaus / components.the-item.js
Last active November 15, 2017 07:42 — forked from lolmaus1/components.the-item.js
ember-drag-sort updating attribute on parent, approach 1
import Ember from 'ember'
export default Ember.Component.extend({
classNames: ['the-item'],
})