snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
12
entc/integration/ent/template/fields.tmpl
Normal file
12
entc/integration/ent/template/fields.tmpl
Normal file
@@ -0,0 +1,12 @@
|
||||
{{/* A template for adding additional fields to specific types. */}}
|
||||
{{ define "model/fields/additional" }}
|
||||
{{- /* Add static fields to the "Card" entity. */}}
|
||||
{{- if eq $.Name "Card" }}
|
||||
// StaticField defined by templates.
|
||||
StaticField string `json:"boring,omitempty"`
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "client/fields/additional/node" }}
|
||||
TemplateField struct{}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user