Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit b95bb18

Browse files
authored
Merge pull request #6873 from serhiyzhovnir/add-information-about-ignoreTmpls-property
Add information about ignoreTmpls property
2 parents 1a8f1b7 + df3c033 commit b95bb18

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/guides/v2.3/ui_comp_guide/concepts/ui_comp_template_literals.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ As a result, a template literal used in the value of one the objects listed abov
4040

4141
Perhaps the most important part of template literals in Magento is the `$` object that can be used inside expressions. (Remember an expression is anything within `${ }`.) The `$` provides access to the `this` context in the JavaScript class where the template literals are. To take it a step further, `this` (and the related `$`) is the KnockoutJS context for the template that can be bound to the UI Component. This object should not be confused with the `$` that marks the beginning of an expression. The `$` object can only appear inside of an expression. Here is an example: `${ $.submitUrl }`: the `$` references the current KnockoutJS context, and `.submitUrl` will return the `provider` property from that object.
4242

43+
### The `ignoreTmpls` property
44+
45+
The `ignoreTmpls` property is an object that prevents template processing for selected properties.
46+
47+
```javascript
48+
return Element.extend({
49+
defaults: {
50+
value: 'some component value',
51+
propertyIgnoreTempls: '${ $.value }', // template literals will be ignored for this property
52+
ignoreTmpls: {
53+
propertyIgnoreTempls: true
54+
} // ignoreTmpls object contains a list of properties with template literals ignored
55+
}
56+
});
57+
```
58+
4359
## Example
4460

4561
Perhaps the most useful aspect of template literals is the ability to access other UI Component JavaScript classes in the registry so we will use this as an example. First, there are a few things to explain.

0 commit comments

Comments
 (0)