Skip to content

Instantly share code, notes, and snippets.

View poteto's full-sized avatar
🥔
ポテト

lauren poteto

🥔
ポテト
View GitHub Profile
<!-- components/edit-location.hbs -->
{{ui.location-map
lat=location.lat
lng=location.lng
setLatLng=(action "setLatLng")
setMarkerRadius=(action "setMarkerRadius")
}}
{{ui.location-form location=location}}
{{ui.location-activity location=location}}
<!-- application.hbs -->
{{edit-location
location=location
ui=(hash
location-map=(component "google-map")
location-form=(component "edit-location-form")
location-activity=(component "location-activity"))
}}
// components/edit-location.js
export default Component.extend({
actions: {
setLatLng(latLng) {
// logic
},
setMarkerRadius(radius) {
// logic
<!-- components/edit-location.hbs -->
{{google-map
lat=location.lat
lng=location.lng
setLatLng=(action "setLatLng")
setMarkerRadius=(action "setMarkerRadius")
}}
{{edit-location-form location=location}}
{{location-activity location=location}}
<!-- templates/application.hbs -->
{{edit-location location=location}}
test('it adds an item', function(assert) {
let dummyStorage = { /* ... */ };
let dummy = new Player({ storageObject: dummyStorage });
assert.ok(/* ... */);
});
export default class Player {
constructor({ storageObject }) {
this.inventory = storageObject;
}
add(item) {
return this.inventory.add(item);
}
}
export default class Player {
constructor() {
this.inventory = new Bag({ /* ... */ });
}
add(item) {
return this.inventory.add(item);
}
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
// validations/adult.js
import Ember from 'ember';
import UserValidations from './user';
import { validateNumber } from 'ember-changeset-validations/validators';
const { assign } = Ember;
export const AdultValidations = {
age: validateNumber({ gt: 18 })
};