This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action, computed } from '@ember/object'; | |
class Item { | |
@tracked name; | |
constructor(name) { | |
this.name = name; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
@keyframes move { | |
0% { | |
transform: translateX(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async beforeModel() { | |
const curUser = this.get('currentUser.user'); | |
const curCompany = curUser.get('currentCompany'); | |
const { current_conversation_id } = this.paramsFor('messages.index'); | |
const queryParams = { | |
currentConversationId: current_conversation_id, | |
companyId: curCompany.get('id') | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async beforeModel() { | |
const curUser = this.get('currentUser.user'); | |
const curCompany = curUser.get('currentCompany'); | |
const { current_conversation_id } = this.paramsFor('messages.index'); | |
const queryParams = { | |
currentConversationId: current_conversation_id, | |
companyId: curCompany.get('id') | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
let originalErrorHandler: (error: Error) => void | null | undefined; | |
// ToDo: fix error typing | |
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
function throwUnlessMatches(error: any, code?: string | number): void { | |
// eslint-disable-next-line eqeqeq | |
if (code && error.errors && error.errors[0] && error.errors[0].status != code) { | |
throw error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
@tracked | |
appName = 'Ember Twiddle'; | |
@action | |
update (event) { |