Promact/md2

Chips : autocomplete-item-value

Closed this issue · 2 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

selected autocomplete-item-value value should return

What is the current behavior?

Throwing [object Object].
.html

<md2-chips required fxFlex="100%" name="to" #To="ngModel" [(ngModel)]="model.To" placeholder="To" [isRemovable]="true" [isAutoComplete]="true"
               (change)="handleChange($event)"  [autocompleteDataList]="userNameList" autocomplete-item-text="name" autocomplete-item-value="email" item-text="name" md-selected-item="name" #chipsControl="ngModel">
              </md2-chips>

.ts

 this.usersList = res;
        for (let i = 0; i < this.usersList.length; i++) {
          let obj : any ={};
          obj.name=this.usersList[i].emp_login;
          obj.email=this.usersList[i].emp_work_email;
          this.userNameList.push(obj);
        }

autocomplete-item-text is working. but autocomplete-item-value throwing Object itself.

Which versions of Angular, MD2, OS, browsers are affected?

Angular 2.4.x
Os: Windows 10
MD2 : 0.0.17

@Dhursh you have to set both objects with same property or set its specific property, refer API Docs, also please provide plunkr demo to more clear the issue, plunkr template is [Plunker template: http://plnkr.co/edit/rQmUz8WYRh5Vz4gwY8E4?p=info](Plunker template: http://plnkr.co/edit/rQmUz8WYRh5Vz4gwY8E4?p=info)

http://code.promactinfo.com/md2/#/chips
Chips with AutoComplete example also not working, its throwing null