mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
added paperless ui
This commit is contained in:
parent
d5a1a4916e
commit
131533d9eb
173 changed files with 18693 additions and 0 deletions
28
src-ui/src/app/components/search/search.component.ts
Normal file
28
src-ui/src/app/components/search/search.component.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { SearchResult, SearchService } from 'src/app/services/rest/search.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.component.html',
|
||||
styleUrls: ['./search.component.css']
|
||||
})
|
||||
export class SearchComponent implements OnInit {
|
||||
|
||||
results: SearchResult[] = []
|
||||
|
||||
query: string = ""
|
||||
|
||||
constructor(private searchService: SearchService, private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.queryParamMap.subscribe(paramMap => {
|
||||
this.query = paramMap.get('query')
|
||||
this.searchService.search(this.query).subscribe(result => {
|
||||
this.results = result
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue