mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Working functionality to navigate back from attachments to event-detail
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
|
||||
@Component({
|
||||
@@ -12,8 +12,9 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
export class AttachmentsPage implements OnInit {
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
|
||||
constructor(private attachamentsService: AttachmentsService, private activatedRoute: ActivatedRoute, private iab: InAppBrowser) { }
|
||||
constructor(private attachamentsService: AttachmentsService, private activatedRoute: ActivatedRoute, private iab: InAppBrowser, private route: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
/* Emit new data when something changes */
|
||||
@@ -30,6 +31,8 @@ export class AttachmentsPage implements OnInit {
|
||||
{
|
||||
this.attachamentsService.getEventAttachments(eventid).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
this.pageId = eventid;
|
||||
console.log(this.pageId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,4 +42,8 @@ export class AttachmentsPage implements OnInit {
|
||||
browser.show();
|
||||
}
|
||||
|
||||
navigateBack(){
|
||||
this.route.navigate(['/home/events',this.pageId]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user