mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
New Attachmentes Page with Skeleton. EventAttachments Model revised. Compatibility with v2. Get Attachments revised.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attachments',
|
||||
templateUrl: './attachments.page.html',
|
||||
styleUrls: ['./attachments.page.scss'],
|
||||
})
|
||||
export class AttachmentsPage implements OnInit {
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
|
||||
constructor(private attachamentsService: AttachmentsService, private activatedRoute: ActivatedRoute) { }
|
||||
|
||||
ngOnInit() {
|
||||
/* Emit new data when something changes */
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if(!paramMap.has('eventId')){
|
||||
//Redirect
|
||||
return;
|
||||
}
|
||||
this.loadAttachments(paramMap.get('eventId'));
|
||||
});
|
||||
}
|
||||
|
||||
loadAttachments(eventid:string)
|
||||
{
|
||||
this.attachamentsService.getEventAttachments(eventid).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user