lundi 12 mars 2018

Angular 5 CheckBox Filter Data

I am trying to filter my data by checkbox

store-sidebar.component: `

<li *ngFor="let category of categories; let i = index">
    <label class="custom-control custom-checkbox">
        <input type="checkbox" name="category" id="checkbox" value="" class="custom-control-input">
        <small class="custom-control-indicator"></small>
        <small class="custom-control-label"></small>
    </label>
</li>

`

getCategories(): void { this.categoriesService.getCategories().subscribe(categories => this.categories = categories); }

store-feeds.component.html:

<div class="storetabContent" *ngFor="let feed of feeds">
<h3></h3>
</div>

getFeeds(): void { this.feedsService.getFeeds().subscribe(feeds => this.feeds = feeds); }

I am getting confused here on how to check it, I mean they are in different components and how should I manage the states.

I tried with Pipes but does not work

I am trying to create checkbox filter like this:

http://carlosroso.com/angular2-shop




Aucun commentaire:

Enregistrer un commentaire