diff --git a/src/app/search/search-routing.module.ts b/src/app/search/search-routing.module.ts index d7b9b51..a313045 100644 --- a/src/app/search/search-routing.module.ts +++ b/src/app/search/search-routing.module.ts @@ -4,7 +4,8 @@ import { SearchComponent } from './search.component'; const routes: Routes = [ - { path: ':query', component: SearchComponent } + { path: ':query', component: SearchComponent }, + { path: '', component: SearchComponent } ]; @NgModule({ diff --git a/src/app/search/search.component.ts b/src/app/search/search.component.ts index c6d46da..45776b1 100644 --- a/src/app/search/search.component.ts +++ b/src/app/search/search.component.ts @@ -2,7 +2,6 @@ import { Component } from '@angular/core'; import { User } from '../../model/User'; import { ActivatedRoute } from '@angular/router'; import { UserService } from '../services/data/user.service'; -import { SmallUserComponent } from '../shared/views/small-user/small-user.component'; @Component({ selector: 'app-search', @@ -14,7 +13,7 @@ export class SearchComponent { users: Array | undefined; constructor(private route: ActivatedRoute, private userSvc: UserService) { - this.route.params.subscribe(params => { this.query = params['query'] }); + this.route.params.subscribe(params => { this.query = params['query'] ? params['query'] : "" }); } ngOnInit(): void {