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 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' } |
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'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
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'; | |
export default class extends Component { | |
obj = { birthday: new Date() }; | |
} |
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'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
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
<BsForm | |
@formLayout="vertical" | |
@model={{this.changeset}} | |
@onSubmit={{action "register"}} | |
class="register-form" | |
as |form| | |
> | |
<h2>{{t "forms.register.headings.account"}}</h2> |
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 { inject as service } from '@ember/service'; | |
import { action } from "@ember/object"; | |
import { tracked } from "@glimmer/tracking"; | |
export default class LoginController extends Controller { | |
@tracked errorMessage; | |
@service session; | |
identification = '[email protected]'; |
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 { formText } from '../lib/form-text'; | |
export default Ember.Component.extend({ | |
init() { | |
this._super(...arguments); | |
this.set('formText', formText('game')); | |
} | |
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
{{!-- templates/components/my-form.hbs --}} | |
{{#bs-form model=changeset | |
formLayout="vertical" | |
onSubmit=(action submit changeset) | |
class='mb-5' as |form|}} | |
{{!-- other stuff --}} | |
{{form.element controlType="power-select" |
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({ | |
}).reopenClass({ | |
positionalParams: ['filterParam'] | |
}); |
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
def class_keywords | |
const_name = self.class.to_s.parameterize(separator: '_').upcase | |
"Metatag::Keywords::#{const_name}".try(:constantize) | |
end | |
# returns NameError: uninitialized constant Metatag::Keywords::WHERE_UNDEFINED |
NewerOlder