Я пытаюсь добавить SweetAlert, когда контактная форма успешно, но не знаю, как добавить сладкое оповещение в firebase angular соединении.
contact-service.service.ts
import { Injectable } from '@angular/core';
import { AngularFirestore } from "@angular/fire/firestore";
import swal from 'sweetalert';
@Injectable({
providedIn: 'root'
})
export class ContactServiceService {
constructor(private firestore: AngularFirestore) { }
/* Add Document */
AddDocument(document: Document) {
return new Promise<any>((resolve, reject) => {
this.firestore.collection("contact").add(document)
.then(res => {
resolve(res);
}, err => reject(err));
});
}
}
contact.component.ts
Пожалуйста, дайте ваши предложения.