For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deferred attribute resolving

Defer bound attributes until FactFinder resolves their data.

Documentation

Avoid invalid requests caused by unresolved data bindings

Some attributes, such as image-related src and srcset, cannot use data binding directly. The browser fetches images immediately during HTML parsing.

<ff-record>
    <!-- Causes an error while the browser is parsing HTML. -->
    <img src="{{record.imageURL}}">
</ff-record>

The data binding has not yet been resolved. The resulting request uses an invalid source and causes an error.

Eventually, src resolves and the image displays correctly. The initial parsing error remains undesirable.

Use image binding to avoid this error. Image binding only works with the src attribute. It also only supports ff-record, ff-suggest-item, and ff-asn-group-element.

A more general solution

Deferred attribute resolving offers a more general solution. It also supports ff-template.

It works like image binding. You can choose any attribute to resolve later.

Supported elements:

  • ff-record

  • ff-suggest-item

  • ff-asn-group-element

  • ff-template

Setup

Place data-ffw-defer on the target ff- element. Its value is a comma-separated list of attributes to resolve indirectly.

Inside the element, add counterpart attributes with the relevant data binding:

For the src and srcset attributes, this would look like:

Fallback in case of attribute name collisions

If you already use the same attribute naming pattern, use the alias. It is functionally identical and adds ffw- to the name.

You can use the regular attribute and alias together. In that case, Web Components resolves only the alias.

Last updated

Was this helpful?