{{ message }}
import { Component, OnInit } from '@angular/core'; import { AnimationController, ModalController } from '@ionic/angular'; import { SearchDocument } from 'src/app/models/search-document'; import { SearchPage } from 'src/app/pages/search/search.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-add-note', templateUrl: './add-note.page.html', styleUrls: ['./add-note.page.scss'], }) export class AddNotePage implements OnInit { note: string = ''; documents:SearchDocument[] = []; loadedAttachments:any; constructor( private modalController: ModalController, private animationController: AnimationController, ) { this.note = ''; } ngOnInit() { } close(){ this.modalController.dismiss(''); } save(){ let body = { "note":this.note, "documents":this.documents, } this.modalController.dismiss(body); } async getDoc() { const modal = await this.modalController.create({ component: SearchPage, cssClass: 'modal-width-100-width-background modal', componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, select: true } }); await modal.present(); modal.onDidDismiss().then((res)=>{ if(res){ const data = res.data; this.documents.push(data.selected); } }); } removeAttachment(index: number){ this.documents = this.documents.filter( (e, i) => index != i); } async successMessage(message?: any, callback?) { let notification = document.createElement('div') notification.id = 'notification' notification.innerHTML = `
{{ message }}