You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -32,7 +32,7 @@ This layout can be turned into a template tag component by wrapping the code in
32
32
33
33
The top-level template tag is exported as the default component from the file. You *can* write this export explicitly, but it's not necessary. The following example is equivalent to the previous one.
A `<template>` tag can also be embedded inside a class definition of a component. This is useful when you need to add state or other logic to your component. Take for example the following "Avatar" component, where a default title is added when the `title` argument is not provided.
@@ -69,7 +69,7 @@ In Ember templates, **“invokables”** are things you can *invoke* in a templa
69
69
70
70
When making use of the "Avatar" component as defined before in a different component file, it first needs to be imported. This is done using the `import` statement, just like you would import any other JavaScript module.
@@ -131,7 +131,7 @@ Importing helpers and modifiers from your own app also follows the same principl
131
131
132
132
Prior to the template tag format, helpers and modifiers were referenced based on their name in the "kebab-case" convention. For example, a `randomNumber` function as helper would be referenced as `{{random-number}}` in a template. In the new way of doing things, standard module import conventions are used. This means that the helper is referenced using the name it is exported as, which is `randomNumber` in this case.
import randomNumber from '../helpers/random-number';
136
136
137
137
<template>
@@ -145,7 +145,7 @@ Just as with components, helpers, and modifiers from your own app, external invo
145
145
146
146
The structure of files within Ember addons is mostly standardized. This means that the path to import from can be derived from the addon's name. For example, an addon that is named `ember-foo` will likely have its components, helpers, and modifiers available as default import from the following locations:
147
147
148
-
```text
148
+
```gjs
149
149
ember-foo/components/example-component
150
150
ember-foo/helpers/example-helper
151
151
ember-foo/modifiers/example-modifier
@@ -216,7 +216,7 @@ The template tag format follows JavaScript module syntax. Any value that isn't e
216
216
217
217
In the following example, a "Square" component is defined that calculates the square of a number. The `value` constant is defined locally, and the `square` helper function is only available within the component.
@@ -236,7 +236,7 @@ The template tag format allows defining multiple components within a single file
236
236
237
237
The following example defines a "CustomSelect" component that renders a `<select>` element with a list of options. The locally-defined "Option" component is used to render each option in the list.
0 commit comments