Skip to content

Instantly share code, notes, and snippets.

Andrew Kirwin amk221

Block or report user

Report or block amk221

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
things: Ember.A([
'Thing 1',
'Thing 2',
'Thing 3'
]),
actions: {
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
willBlurInput() {
console.log('focus out');
}
}
});
@amk221
amk221 / _template.hbs
Last active Jun 10, 2019
ember style attribute helpers
View _template.hbs
<div style={{html-safe (concat "background-color: " (escape this.userColour))}}>
</div>
View components.my-child-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['my-child-component']
});
View controllers.application.js
import Ember from 'ember';
import { set } from '@ember/object';
export default Ember.Controller.extend({
actions: {
setName() {
this.name = "foo";
// set(this, 'name', 'foo');
}
}
@amk221
amk221 / brand-colours.js
Last active Apr 1, 2019
Ember Brand colours component in Styleguide
View brand-colours.js
import Component from '@ember/component';
import layout from './template';
const { getComputedStyle } = window;
/**
* This component is used in the styleguide to look up our brand colours
* and render them.
*
* To be used in conjunction with:
*
View controllers.application.js
import Ember from 'ember';
class MyObject {
constructor(name) {
this.name = name;
}
}
export default Ember.Controller.extend({
items: {
@amk221
amk221 / components.my-component.js
Created Dec 10, 2018
Component helper action test
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['my-component']
});
View adapters.application.js
import RESTAdapter from 'ember-data/adapters/rest';
export default RESTAdapter.extend();
You can’t perform that action at this time.