Replace space by +

This commit is contained in:
Mathieu Sanchez 2019-06-12 22:25:20 +09:00
parent 9347c36883
commit 1b2c44eb83

View File

@ -20,7 +20,7 @@ export class AppComponent {
if ( this.searchInput.length > 0 ) { if ( this.searchInput.length > 0 ) {
this.displayOverlay = true; this.displayOverlay = true;
this.http.get( environment.baseUrl + this.searchInput ).subscribe( ( data: [{ url: string, tfidf: string }] ) => { this.http.get( environment.baseUrl + this.searchInput.replace( ' ', '+' ) ).subscribe( ( data: [ { url: string, tfidf: string } ] ) => {
this.results = data; this.results = data;
this.results.sort( ( f, s ) => { this.results.sort( ( f, s ) => {
if ( parseFloat( f.tfidf ) > parseFloat( s.tfidf ) ) { if ( parseFloat( f.tfidf ) > parseFloat( s.tfidf ) ) {