|
|
|
|
@ -38,6 +38,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.common.startLoading();
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.getAnnouncementListService();
|
|
|
|
|
}
|
|
|
|
|
@ -59,6 +60,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
this.announcementList.forEach(element => {
|
|
|
|
|
if (element.id === item.id) {
|
|
|
|
|
this.announcementService.getAnnouncementListService(this.pageSize, item.id).subscribe((result: any) => {
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
|
data = JSON.parse(holdData.result.data)[0];
|
|
|
|
|
@ -73,7 +75,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
img: data.Banner_Image
|
|
|
|
|
};
|
|
|
|
|
element.isOpen = !element.isOpen;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
// this.common.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
console.log(this.detialData);
|
|
|
|
|
});
|
|
|
|
|
@ -89,22 +91,19 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAnnouncementListService() {
|
|
|
|
|
this.common.startLoading();
|
|
|
|
|
// this.common.startLoading();
|
|
|
|
|
let holdData;
|
|
|
|
|
this.announcementService.getAnnouncementListService(this.pageSize).subscribe((result: any) => {
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
|
this.listOfAnnouncement = JSON.parse(holdData.result.data);
|
|
|
|
|
this.pageLength = this.listOfAnnouncement[0].TotalItems;
|
|
|
|
|
for (let i = 0; i < this.listOfAnnouncement.length; i++) {
|
|
|
|
|
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN;
|
|
|
|
|
// this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN.replace(/\ /g, '');
|
|
|
|
|
this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR;
|
|
|
|
|
// this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR.replace(/\ /g, '');
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN;
|
|
|
|
|
// this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN.replace(/\ /g, '');
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR;
|
|
|
|
|
// this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR.replace(/\ /g, '');
|
|
|
|
|
this.arr[i] = {
|
|
|
|
|
id: this.listOfAnnouncement[i].rowID,
|
|
|
|
|
title_EN: this.listOfAnnouncement[i].Title_EN,
|
|
|
|
|
@ -121,7 +120,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
this.arrList.push(this.arr[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
// this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|