Angular NgFor Path Issue

Published

In my Angular Application i have a simple ngFor loop showing logo images like this:

<div *ngFor="let item of list" class="logo-wrapper">
          <div class="customer-logo">
            <span
              class="my-icon"
              aria-label="My icon"
              [inlineSVG]="'./assets/image/projects/logo/' + item.logo"
            ></span>
          </div>
        </div>

This is working fine!
But: If i try to slice the Array to limit the output as follow:

<div *ngFor="let item of list | slice: 0:10; let i = index" class="logo-wrapper">
      <div class="customer-logo">
        <span
          class="my-icon"
          aria-label="My icon"
          [inlineSVG]="'./assets/image/projects/logo/' + item.logo"
        ></span>
      </div>
    </div>

I get this Error : "Object is of type ‘unknown’".
Error Output

I realy don’t know what im doing wrong here. I hope someone can point me in the right direction.

Source: AngularJS Questions

Published
Categorized as angular, angularjs, angularjs-directive, html, typescript Tagged , , , ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq