Skip to content

Instantly share code, notes, and snippets.

@kitsuneyo
Last active August 20, 2020 22:52
Show Gist options
  • Save kitsuneyo/b0173e4828647fc325f126d5017b5f53 to your computer and use it in GitHub Desktop.
Save kitsuneyo/b0173e4828647fc325f126d5017b5f53 to your computer and use it in GitHub Desktop.
New Twiddle
import Controller from '@ember/controller';
import Changeset from 'ember-changeset';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
constructor() {
super(...arguments);
this.changeset = new Changeset(
{ date: new Date(), name: 'Jo' }
);
}
}
<h1>Pikaday form input</h1>
<BsForm
@formLayout="vertical"
@model={{this.changeset}}
as |form|
>
<form.element
@label="Date"
@property="date"
as |el|
>
<PikadayInput
@value={{el.value}}
@class={{el.validation}}
@onSelection={{action (mut el.value)}}
id={{el.id}}
class="form-control"
@format="D MMM YYYY"
/>
</form.element>
<form.element @label="Name" @property="name" />
</BsForm>
{
"version": "0.17.1",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
"_APPLICATION_TEMPLATE_WRAPPER": true,
"_JQUERY_INTEGRATION": true
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js",
"ember": "3.18.1",
"ember-template-compiler": "3.18.1",
"ember-testing": "3.18.1",
"bootstrap": "4.5.0"
},
"addons": {
"@glimmer/component": "1.0.0",
"ember-bootstrap": "3.1.3",
"ember-pikaday": "3.0.0",
"ember-cli-moment-shim": "3.8.0",
"ember-changeset-validations": "3.7.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment