A
A
Alexey Yakovlev2020-09-06 19:28:30
Handlebars
Alexey Yakovlev, 2020-09-06 19:28:30

I don't understand what's wrong, there is an error in the each loop, how to fix it?

Cycle:

<ul class="list-cards">
                            {{#each products}}
                                <li class="card" data-size="{{size}}">
                                    <a href="/products/{{id}}" title="{{title}}">
                                        <div class="card__block-img">
                                            <figure>
                                                <img src="{{img}}" alt="{{title}}">
                                            </figure>
                                        </div>
                                        <div class="card__description">
                                            <span class="card-name">{{title}}</span>
                                            <div class="card__block-price">
                                                <span class="card-old-price">{{oldPrice}}</span>
                                                <span class="card-now-price">{{nowPrice}}</span>
                                                <span class="card-sale">{{sale}}</span>
                                            </div>
                                        </div>
                                    </a>
                                </li>
                            {{/each}}
                        </ul>


Error:
Handlebars: Access has been denied to resolve the property "size" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details
[0] Handlebars: Access has been denied to resolve the property "id"
because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details
[0] Handlebars: Access has been denied to resolve the property "title" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details
[0] Handlebars: Access has been denied to resolve the property "img" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details
[0] Handlebars: Access has been denied to resolve the property "oldPrice" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt...for details
[0] Handlebars: Access has been denied to resolve the property "nowPrice" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details
[0] Handlebars: Access has been denied to resolve the property "sale" because it is not an "own property" of its parent.
[0] You can add a runtime option to disable the check or this warning:
[0] See https://handlebarsjs.com/api-reference/runtime-opt... for details

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question