mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve search page
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sender',
|
||||
templateUrl: './sender.page.html',
|
||||
@@ -12,7 +13,8 @@ export class SenderPage implements OnInit {
|
||||
|
||||
contacts: EventPerson[];
|
||||
showContacts: EventPerson[];
|
||||
|
||||
sender: string;
|
||||
selectedUser: string;
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private ContactsService: ContactsService) {
|
||||
@@ -28,23 +30,29 @@ export class SenderPage implements OnInit {
|
||||
this.contacts = res;
|
||||
});
|
||||
}
|
||||
|
||||
filterContact(){
|
||||
|
||||
filterContact(findName){
|
||||
console.log(findName)
|
||||
// const persons = this.contacts.filter((person) => {
|
||||
const findPerson = this.sender.toLowerCase();
|
||||
const persons = this.contacts.filter((person) => {
|
||||
|
||||
// if (person.Name.indexOf(findName) == 0){
|
||||
// return true;
|
||||
// }
|
||||
if (person.Name.toLowerCase().indexOf(findPerson) == 0){
|
||||
return true;
|
||||
}
|
||||
|
||||
// });
|
||||
|
||||
// this.showContacts = persons;
|
||||
});
|
||||
|
||||
this.showContacts = persons;
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
selectUser(username:string){
|
||||
console.log(username);
|
||||
this.selectedUser = username;
|
||||
this.close(this.selectedUser);
|
||||
}
|
||||
|
||||
close(username: string){
|
||||
this.modalController.dismiss(username);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user