angular2-multiselect-dropdown
Advanced tools
Comparing version 1.1.9 to 1.2.0
{ | ||
"name": "angular2-multiselect-dropdown", | ||
"version": "1.1.9", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "angular-cli": {}, |
@@ -67,8 +67,10 @@ import { Component, OnInit, NgModule, OnChanges, ViewEncapsulation,forwardRef, Input, Output, EventEmitter, ElementRef, AfterViewInit, Pipe, PipeTransform } from '@angular/core'; | ||
this.settings = Object.assign(this.defaultSettings, this.settings); | ||
/* this.selectedItems = []; | ||
for(var t=0;t<this.data.length;t++){ | ||
if(this.data[t]){ | ||
this.selectedItems.push(this.data[t]); | ||
} | ||
ngDoCheck(){ | ||
if(this.selectedItems){ | ||
console.log(this.selectedItems.length); | ||
if(this.selectedItems.length == 0 || this.data.length == 0 || this.selectedItems.length < this.data.length){ | ||
this.isSelectAll = false; | ||
} | ||
}*/ | ||
} | ||
} | ||
@@ -136,3 +138,3 @@ onItemClick(item: ListItem, index: number){ | ||
} | ||
if(this.selectedItems.length === this.data.length){ | ||
if(this.selectedItems.length === this.data.length && this.data.length > 0){ | ||
this.isSelectAll = true; | ||
@@ -177,3 +179,3 @@ } | ||
removeSelected(clickedItem: ListItem){ | ||
this.selectedItems.forEach(item => { | ||
this.selectedItems && this.selectedItems.forEach(item => { | ||
if(clickedItem.id === item.id){ | ||
@@ -180,0 +182,0 @@ this.selectedItems.splice(this.selectedItems.indexOf(item),1); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24732
279