ng2-ui / auto-complete

Angular Auto Complete component and directive
https://ng2-ui.github.io/dist/#/auto-complete
MIT License
279 stars 123 forks source link

Need help with real world simple example. #247

Closed Gaelmart closed 6 years ago

Gaelmart commented 7 years ago

To get 11 32 35 etc to come up in dropdown with this being the json returned from server api, what option should I use.

[{"gcpart":"11"},{"gcpart":"32"},{"gcpart":"35"},{"gcpart":"37"},{"gcpart":"41"},{"gcpart":"42"},{"gcpart":"43"},{"gcpart":"44"},{"gcpart":"47"},{"gcpart":"51"},{"gcpart":"52"},{"gcpart":"53"}]

Currently got this which does nothing expect display 'Loading '

 <input ngui-auto-complete 
                                   display-property-name="gcpart" 
                                   select-value-of="gcpart"  
                                   loading-text="Loading " 
                                   list-formatter="myListFormatter"  
                                   [source]="observableSource1.bind(this)"  
                                   [(ngModel)]="txtAGC1"  
                                   name="txtAGC1"   
                                   class="form-control txtAGC" 
                                   id="txtAGC1" move-next-on-maxlength />

Being at it for 2 days running 100's of variations as there is no help.

Also This never gets called so not sure what the list-formatter setting is supposed to do.


 public  myListFormatter(data: any): string {
        console.log(data);
        return data;
   }

Thanks

Gary

allenhwkim commented 7 years ago

Please create a plunker example for this.