Skip to content

Instantly share code, notes, and snippets.

View miguelcobain's full-sized avatar

Miguel Andrade miguelcobain

View GitHub Profile
import Controller from '@ember/controller';
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked lat = 38.77;
@tracked long = -100.79;
@tracked zoom = 3;
import Controller from '@ember/controller';
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked lat = 38.77;
@tracked long = -100.79;
@tracked zoom = 3;
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class extends Component {
@action
didInsertNode() {
console.log('didInsertNode', this.args.type);
}
}
export default Ember.Controller.extend({
lat: -27.5555,
lng: 152.94703,
zoom: 7,
test1:[-27.5555, 152.94703],
test2:[-27.69149, 153.01561],
test3:[-28.5, 153.01561],
test4:[-28.5, 150.01561],
@miguelcobain
miguelcobain / controllers.application.js
Created February 5, 2018 22:10
ember-sortable focus issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
items: [
{
name: 'Miguel'
},
{
@miguelcobain
miguelcobain / controllers.application.js
Last active May 23, 2017 14:33
ember paper radio group
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
store: Ember.inject.service(),
init() {
this._super(...arguments);
this.set('model', [
this.get('store').createRecord('my-model', { name: '1' }),
this.get('store').createRecord('my-model', { name: '2' }),
@miguelcobain
miguelcobain / components.child-component.js
Created March 21, 2017 11:37
child component property
import Ember from 'ember';
import { ChildMixin } from 'ember-composability-tools';
export default Ember.Component.extend(ChildMixin, {
tagName: 'li'
});
@miguelcobain
miguelcobain / components.my-component.js
Created March 13, 2017 18:53
self-rendering compoennt
import Ember from 'ember';
export default Ember.Component.extend({
onInput(e) {
let owner = Ember.getOwner(this);
let component = Ember.Component.extend({
layout: Ember.HTMLBars.compile(e.target.value),
renderer: owner.lookup('renderer:-dom')
import Ember from 'ember';
const { Controller } = Ember;
export default Controller.extend({
lat: 45.528178,
lng: -122.670059,
zoom: 14,
restaurants: Ember.A([
{
@miguelcobain
miguelcobain / controllers.application.js
Created March 1, 2017 15:33
ember-leaflet fill on hover
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});