Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //HTML
- <div class="col-lg-3">
- <div class="input-group" style="margin-top:15%;margin-left:200px;">
- <input class="pull-right" style="width: 150px;" placeholder="Search..." #mysearch [ngModel]="mymodel" (ngModelChange)="Search(mysearch.value)" (focusout)="Search(mysearch.value)" (keydown.backspace)="Search(mysearch.value)" (keypress)="Search(mysearch.value)" (keyup.enter)="Search(mysearch.value)"/>
- </div>
- </div>
- //TS
- ngOnInit() {}
- @ViewChild("mysearch") mysearch;
- getPage(page){
- this.p=page;
- // this.getVerifiedUsers(page);
- if(!(this.mysearch.nativeElement.value)) {
- this.getVerifiedUsers(page);
- }
- else{
- var name = this.mysearch.nativeElement.value;
- this.Search(name,page);
- }
- }
- //ADMIN SERVICE TS
- getSearchData(name,flag,page){
- var headers = this.getHeadersForMultipart();
- if(page!=undefined)
- var skip = (page - 1) * this.limit;
- else
- var skip =0;
- var body={skip:skip,limit:this.limit,name:name,flag:flag};
- return this.http.post(this.baseUrl+'searchData', body, {headers:headers})
- .map(response => response.json())
- .catch(this.errorHandler);
- }
Add Comment
Please, Sign In to add comment