Skip to content

Instantly share code, notes, and snippets.

Avatar

Ross Haggart rossjha

  • Brechin, Angus, UK
View GitHub Profile
View bug-report.md

Summary

Summarise the bug encountered concisely.

Steps to reproduce

How one can reproduce the issue - this is very important.

View controllers.application\.js
import Controller from '@ember/controller';
import { get, set } from "@ember/object"
export default Controller.extend({
// url: 'https://604630b1f0c6dc00177b180b.mockapi.io/api/v1/posts',
// async init() {
// this._super(...arguments);
// const posts = await this.fetchPosts(this.url);
View controllers.users\.js
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class UsersController extends Controller {
@tracked active = true;
@action updateActive(evt) {
this.active = evt.target.checked;
}
View components.click-outside\.js
import Component from '@ember/component';
export default Component.extend({
// Lifecycle hooks
didInsertElement() {
this._super(...arguments);
document.addEventListener('click',
this.handleOutsideClick.bind(this)
);
View components.my-component\.js
import Component from '@ember/component';
export default Component.extend({
// Functions
actions: {
checkWildcardContext() {
console.log("$('*')", $('*'));
console.log("this.$('*')", this.$('*'));
}
}
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
}
@rossjha
rossjha / components.ui-iframe\.js
Last active Sep 2, 2021
window-message-iframe
View components.ui-iframe\.js
import Component from '@ember/component';
export default Component.extend({
// Properties
tagName: 'iframe',
attributeBindings: ['src', 'title'],
classNames: ['w-full', 'h-screen', 'border-none']
});
View components.ui-iframe\.js
import Component from '@ember/component';
export default Component.extend({
tagName: 'iframe',
attributeBindings: ['src', 'title'],
classNames: ['w-full', 'h-screen', 'border-none'],
src: '',
title: 'test',
didInsertElement() {
View components.resizeable-table\.js
import Component from '@ember/component';
export default Component.extend({
tagName: 'table',
classNames: ['resizable']
});