From 000e1d53a85a58191032e8adfab896a47db9a658 Mon Sep 17 00:00:00 2001 From: Nikolaos Laskaris Date: Wed, 8 Nov 2017 15:51:16 +0200 Subject: [PATCH] Finalized the autocomplete component --- dmp-frontend/package-lock.json | 5 +++++ dmp-frontend/package.json | 1 + dmp-frontend/src/app/app.component.html | 4 ++-- .../autocomplete-remote.component.html | 15 +-------------- .../autocomplete-remote.component.ts | 4 +++- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json index 48d37a331..862ae0bf5 100644 --- a/dmp-frontend/package-lock.json +++ b/dmp-frontend/package-lock.json @@ -673,6 +673,11 @@ } } }, + "angular2-uuid": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/angular2-uuid/-/angular2-uuid-1.1.1.tgz", + "integrity": "sha1-cvA81TK39AAy6x7PufhFc4S+lW4=" + }, "ansi-escapes": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 64a5f00ca..449ec6187 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -28,6 +28,7 @@ "angular2-datatable": "^0.6.0", "angular2-draggable": "^1.0.7", "angular2-number-picker": "^0.8.8", + "angular2-uuid": "^1.1.1", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "flat": "^4.0.0", diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index 3d3ba0f17..ea80ba1b9 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -66,9 +66,9 @@ - + \ No newline at end of file diff --git a/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.html b/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.html index a1504cfe8..4dff6263e 100644 --- a/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.html +++ b/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.html @@ -1,18 +1,5 @@ - - -
- selectedValue: {{selectedValue}}
- query: {{query}}
- +
diff --git a/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.ts b/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.ts index f25de0953..31f469760 100644 --- a/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.ts +++ b/dmp-frontend/src/app/form/fields/autocomplete-remote/autocomplete-remote.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit,Input, Output, EventEmitter} from '@angular/core'; import { ServerService } from '../../../services/server.service'; - +import { UUID } from 'angular2-uuid'; import { NguiAutoCompleteModule } from '@ngui/auto-complete'; declare var $: any; @@ -30,6 +30,8 @@ export class AutocompleteRemoteComponent implements OnInit { query : string = ""; ngOnInit() { + if(this.id == null) + this.id = UUID.UUID(); this.updateByQuery(this.query); //just to trigger the first call }