#How to communicate values with in the html template form for loop to separate div ?
10 messages · Page 1 of 1 (latest)
selector: 'infinite-scroll',
template:
<div class="container">
<ais-instantsearch [config]="config">
<div class="search-panel">
<div class="search-panel__results">
<div class="searchbox">
<ais-search-box placeholder=""></ais-search-box>
</div>
<ais-stats>
<ng-template let-state="state">{{'hit.length'}}
{{state.nbHits}} results .
</ng-template>
</ais-stats>
<ais-infinite-hits>
<ng-template
let-hits="hits"
let-results="results"
let-refine="showMore"
>
<h2>this value of length {{hits.length}}</h2>
<div *ngIf="hits.length === 0">No results found.</div>
<ol class="ais-Hits-list">
<li class="ais-Hits-item" *ngFor="let hit of hits">
<ais-highlight attribute="name" [hit]="hit"></ais-highlight>
</li>
<div (onVisible)="refine()"></div>
</ol>
<ol class="ais-Hits-list">
<li class="ais-Hits-item" *ngFor="let result of results">
<ais-highlight attribute="name" [hit]="result"></ais-highlight>
</li>
<div (onVisible)="refine()"></div>
</ol>
</ng-template>
</ais-infinite-hits>
</div>
</div>
</ais-instantsearch>
</div> ```
g!badeyes @ashen rose
@ashen rose Please do not post pictures of code (especially photos of a physical screen) as they are difficult to read and difficult to correct (as you cannot copy code from a screenshot to modify it).
g!codeblock @ashen rose
@ashen rose, you can use the following snippet to have your code formatted and colored by Discord. Replace ts with the language you need (i.e. html, js, css, etc)
```ts
// your code goes here
```
And check that typo in html interpolation hits.lenth instead of hits.length
@stark condor typo is corrected . but not working .