mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Working functionality to navigate back from attachments to event-detail
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button routerDirection="back" defaultHref="" icon="chevron-back"></ion-back-button>
|
||||
<ion-back-button (click)="navigateBack()" defaultHref="" icon="chevron-back"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Anexos do evento</ion-title>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
ion-back-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* CONTENT */
|
||||
ion-content{
|
||||
--background: #f2f2f2;
|
||||
|
||||
@@ -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