GithubHelp home page GithubHelp logo

hardy12994 / ng4-auto-complete Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 57 KB

Using Input Tag and on type the list refresh, with Features - show list length, taking String/Object list, list trigger on word count, takes string and gives string

TypeScript 95.58% JavaScript 4.42%

ng4-auto-complete's People

Contributors

hardy12994 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ng4-auto-complete's Issues

Object List Found! Please provide filterName to pluck from object

HTML SETUP

<input id="list" [ng4-auto-complete]="users" [word-trigger]="2" [list-length]="10" filterName="username"
              no-record-text="No Records Found!" type="text" class="form-control" placeholder="Pesquisar por usuário"
              (keyup.enter)="addUser()" [(ngModel)]="userEmail" />

ANGULAR SETUP

private setList(users) {
    this.AutoCompleteService.setDynamicList(users);
  }

  private getUsers() {
    this.UserService.getUsers().subscribe(
      (res: any) => {
        this.users = res;
        this.setList(this.users);
      },
      (err: any) => {
        console.log(err);
      }
    );
  }

this method getUsers returns me a HUGE list of users so its not empty, and the filterName is set to username witch is a field of the array, so i dont know why its not working at all,
I've set up the modules and the .ts correctly

EDIT: using node 8.10 and angular 4.4.6

static list found empty

ngOnInit() { this.test() }
test() { let test = this.http.get('http://localhost:8080/v1/places/all') .subscribe((res: Response) => { this.places = res.json() }); }

<input class="form-control" placeholder="Bestemming" id="place" name="place" [ng4-auto-complete]="places" no-record-text="Geen resultaat gevonden">

Output:

static list found empty

{{ places }} works, [ng4-auto-complete]="places" doesn't.

I'm lost for words, and I've been stuck on this problem for over two hours and I can't figure it out.

The data I'm trying to use AutoComplete on:
[ "Gouda", "Bodengraven", "Amsterdam" ]

core.js:1427 ERROR TypeError: $(...).autocomplete is not a function

core.js:1427 ERROR TypeError: $(...).autocomplete is not a function
at AutoCompleteDirective.initDropdown (auto.directive.js:237)
at AutoCompleteDirective.removeOldList (auto.directive.js:339)
at SafeSubscriber.eval [as _next] (auto.directive.js:305)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.next (Subscriber.js:185)
at Subscriber._next (Subscriber.js:125)
at Subscriber.next (Subscriber.js:89)
at HTMLInputElement.handler (FromEventObservable.js:210)
at ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.js:4744)

$(...).autocomplete is not a function

$(...).autocomplete is not a function
initDropdown auto.directive.js:237
configureDirective auto.directive.js:128
ngOnInit auto.directive.js:22
Angular 5
View_ListingComponent_0 ListingComponent.html:186
Angular 24
RxJS 5
Angular 8

Got this error when I am tryng to use.
I also added

<script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> in my index.html

Can you please check why its been not loading

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.