Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Update provider demo #1468

Merged
merged 11 commits into from
Mar 13, 2018
14 changes: 9 additions & 5 deletions src/demos/list/list-provider-demo.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Injectable } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
Expand All @@ -12,6 +12,7 @@ import {
ListItemModel
} from '../../core';

@Injectable()
export class DemoListProvider extends ListDataProvider {
public items: Observable<ListItemModel[]>;
public remoteCount: BehaviorSubject<number> = new BehaviorSubject<number>(0);
Expand Down Expand Up @@ -85,8 +86,10 @@ export class DemoListProvider extends ListDataProvider {
let searchText = request.search.searchText.toLowerCase();

searchedList = items.filter((item) => {
return item.data.column2.toLowerCase().indexOf(searchText) > -1 ||
item.data.column3.toLowerCase().indexOf(searchText) > -1;
return (
item.data.column2.toLowerCase().indexOf(searchText) > -1 ||
item.data.column3.toLowerCase().indexOf(searchText) > -1
);
});
}

Expand All @@ -105,8 +108,9 @@ export class DemoListProvider extends ListDataProvider {

@Component({
selector: 'sky-list-provider-demo',
templateUrl: './list-provider-demo.component.html'
templateUrl: './list-provider-demo.component.html',
providers: [DemoListProvider]
})
export class SkyListProviderDemoComponent {
public listDataProvider: DemoListProvider = new DemoListProvider();
constructor(public listDataProvider: DemoListProvider) {}
}