import { ElementRef, OnInit } from '@angular/core'; import { CfListComponent } from '../list/list.component'; import { SelectListModel } from '../../models/list/select-list'; /** *
Select-list is creating using ListModel and SelectListModel Classes/Components and based on Angular Material List. Component must be provided with template for each item and has selectable functionality.
*Example of using Select-list:
***/ export declare class CfSelectListComponent extends CfListComponent implements OnInit { elementRef: ElementRef; /** *<cf-select-list [settings]="myList" (cfItemAction)="log($event)"></cf-select-list>*
Component property to set template of standard view for each list item. Template must be inside cf-select-list html tags.
*Example:
**<cf-select-list>*<template #itemTpl let-i="cfIndex" let-it="cfItem">*<img md-list-avatar src="{{it.avatar}}">*<div class="mat-list-text">*<h4 md-line>{{it.name}}</h4>*<p md-line>{{it.city}}</p>*</div>*</template>*</cf-select-list>
Where:
*It is Object which will recive data from SelectListModel Class. It is used in cf-select-list template.
*Example of SelectListModel Class:
*{
* title: 'Select-list Component Demo',
* items: [
* { name: 'Austin', city: 'London', avatar: 'http://wfarm2.dataknet.com/static/resources/icons/set3/c9f1cdf473a8.png' },
* { name: 'Molly', city: 'Denver', avatar: 'http://findicons.com/files/icons/1072/face_avatars/300/fh04.png' },
* { name: 'Peter', city: 'Tokyo', avatar: 'http://static.tumblr.com/c172fd03bf2bedb77e13107cb22cdcc1/3rxa3xq/asBo7l3wr/tumblr_static_6fbdkgohxjgoc4c8o8kwoso4k.png' }
* ],
* selected: this.mySelectedItems,
* color: {
* checked: 'lightseagreen',
* unchecked: 'darkorchid'
* }
* }
*