Last active
May 22, 2019 22:56
-
-
Save les2/356e496aa3ee485f55137419c74aa4fc to your computer and use it in GitHub Desktop.
maybe-glimmer-bug
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'; | |
export default Ember.Component.extend({ | |
items: [ | |
{ | |
id: 1, | |
type: 'thing-with-query', | |
name: 'I am thing 1', | |
query: JSON.stringify({ | |
"and": [ | |
{ "lhs": "a", "op": "==", "rhs": 123 }, | |
{ "lhs": "x", "op": "==", "rhs": "87" } | |
] | |
}) | |
}, | |
{ | |
id: 2, | |
type: 'thing-with-query', | |
name: 'I am thing 2', | |
query: JSON.stringify({ | |
"and": [ | |
{ "lhs": "foo", "op": "==", "rhs": "bar" }, | |
{ "lhs": "dr", "op": "==", "rhs": "seuss" } | |
] | |
}) | |
}, | |
{ | |
id: 3, | |
type: 'simple-thing', | |
name: 'I am very simple', | |
description: 'Lorem ipsum' | |
} | |
], | |
actions: { | |
showItem(item) { | |
this.set('selectedItem', item); | |
} | |
} | |
}); |
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'; | |
export default Ember.Component.extend({ | |
tagName: 'span', | |
term: null, | |
parentTerm: null | |
}); |
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'; | |
export default Ember.Component.extend({ | |
tagName: 'span', | |
term: null, | |
parentTerm: null | |
}); |
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'; | |
import { computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
tagName: 'span', | |
jsonValue: computed('term', function() { | |
return JSON.stringify(this.get('term'), null, 2); | |
}) | |
}); |
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'; | |
import { computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
term: computed('model', function() { | |
if (this.get('model')) { | |
return JSON.parse(this.get('model').query); | |
} | |
return null; | |
}) | |
}); |
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'; | |
import { computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
tagName: '', | |
term: null, | |
parentTerm: null, | |
termType: computed('term', function() { | |
const term = this.get('term') || {}; | |
if (term.and) { return 'and'; } | |
if (term.op) { return 'expression'; } | |
return 'invalid'; | |
}) | |
}); |
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'; | |
export default Ember.Component.extend({ | |
}); |
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'; | |
export default Ember.Component.extend({ | |
}); |
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'; | |
export default Ember.Controller.extend({ | |
nextTerm: '', | |
term: null, | |
actions: { | |
updateTerm() { | |
console.log('parsing: ', this.get('nextTerm')); | |
this.set('term', JSON.parse(this.get('nextTerm'))); | |
console.log('parsed term: ', this.get('term')); | |
} | |
} | |
}); |
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
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.0.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment