-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more fields to BlogPost card #1935
base: main
Are you sure you want to change the base?
Conversation
FadhlanR
commented
Dec 13, 2024
0df29c2
to
fd4ba09
Compare
@@ -607,7 +637,15 @@ export class BlogPost extends CardDef { | |||
<li class='pub-date'> | |||
Published on | |||
<time timestamp={{@model.datePublishedIsoTimestamp}}> | |||
{{this.formattedDatePublished}} | |||
{{@model.formattedDatePublished}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen this pattern before and I don't know why I always assumed this to be wrong.
You use a getter at the root of the CardDef and you use @model.formattedDatePublished to access the model value. This is great bcos you can share these across formats. But, is this different than a computed or not -- do you know? Typically, all my getters exist on the format template.
In general, this is not a change request. Just a curiosity. I thought perhaps the types will fail or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if this is the correct pattern or not. However, it works, and I notice the same pattern in a few cards, such as catalog-entry and leaflet-gtfs. Are you referring to a computed field? This is different from a computed field.