Skip to content

Instantly share code, notes, and snippets.

import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@tracked isOpen = false;
@action
toggle() {
this.isOpen = !this.isOpen;
module.exports = {
defaultBrowser: 'Safari',
handlers: [
// Anything localhost should open in Opera
{
match: finicky.matchHostnames(['localhost']),
browser: 'Opera',
},
// Launch Google Meet on my first user account
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
deletePost(post){
post.deleteRecord();
post.unloadRecord();
}
import Ember from 'ember';
import { isEmpty } from '@ember/utils';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
async validate(model){
isEmpty(model);
}
import Ember from 'ember';
import { isEmpty } from '@ember/utils';
import EmberObject from '@ember/object';
import ObjectProxy from '@ember/object/proxy';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
obj: null,
import Ember from 'ember';
import Changeset from 'ember-changeset';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
save(){
const changeset = new Changeset(this.model.post);
import Ember from 'ember';
import { isEmpty } from '@ember/utils';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
async validate(changeset){
isEmpty(changeset);
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@nickschot
nickschot / controllers.application.js
Last active July 2, 2018 18:56
Setting relationships
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
author1: null,
author2: null,
init(){
this._super(...arguments);
@nickschot
nickschot / controllers.application.js
Last active December 18, 2017 10:48
Ember-animated scroll reproduction
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});