mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { analyzeAndValidateNgModules } from '@angular/compiler';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
|
||||
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
|
||||
|
||||
@@ -18,11 +19,13 @@ export class NewGroupPage implements OnInit {
|
||||
//groupName:string;
|
||||
|
||||
@Input() groupName:string;
|
||||
@Output() closeAllDesktopComponent = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private pickerController: PickerController,
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private chatService: ChatService,
|
||||
//private navParams: NavParams,
|
||||
)
|
||||
{
|
||||
@@ -37,7 +40,19 @@ export class NewGroupPage implements OnInit {
|
||||
this.showDuration = event.detail.checked;
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
//this.modalController.dismiss();
|
||||
console.log('close');
|
||||
this.closeAllDesktopComponent.emit();
|
||||
}
|
||||
|
||||
createGroup(){
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
let body = { "name":name, }
|
||||
this.chatService.addGroup(body).subscribe(res=>{
|
||||
console.log('group created');
|
||||
console.log(res['group']);
|
||||
this.closeAllDesktopComponent.emit(res['group']._id);
|
||||
});
|
||||
}
|
||||
|
||||
async addContacts(){
|
||||
|
||||
Reference in New Issue
Block a user