Skip to content

Commit

Permalink
add atom format to country field
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinthong committed Dec 2, 2024
1 parent 621381e commit 0ade0a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/experiments-realm/country.gts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ export class CountryField extends FieldDef {
@field name = contains(StringField);
@field code = contains(StringField);
static edit = CountryFieldEdit;

static atom = class Atom extends Component<typeof this> {
<template>
{{#if @model.name}}
{{@model.name}}
{{/if}}
</template>
};
}

export class CardWithCountryField extends CardDef {
Expand All @@ -115,7 +123,7 @@ export class CardWithCountryField extends CardDef {

static isolated = class Isolated extends Component<typeof this> {
<template>
<@fields.country />
<@fields.country @format='atom' />
</template>
};
}

0 comments on commit 0ade0a2

Please sign in to comment.