|
|
|
@ -10,7 +10,6 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
|
|
|
|
styleUrls: ['./announcement.component.scss'],
|
|
|
|
styleUrls: ['./announcement.component.scss'],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class AnnouncementComponent implements OnInit {
|
|
|
|
export class AnnouncementComponent implements OnInit {
|
|
|
|
dt = new Date().toJSON().slice(0, 10).replace(/-/g, '/');
|
|
|
|
|
|
|
|
public arr: { id: number, title_EN: string, title_AR: string, body_EN: string, body_AR: string, img: string, date: Date, isopen: boolean }[] = [];
|
|
|
|
public arr: { id: number, title_EN: string, title_AR: string, body_EN: string, body_AR: string, img: string, date: Date, isopen: boolean }[] = [];
|
|
|
|
public arrList = [];
|
|
|
|
public arrList = [];
|
|
|
|
public listOfAnnouncement;
|
|
|
|
public listOfAnnouncement;
|
|
|
|
@ -51,7 +50,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
let holdData;
|
|
|
|
let holdData;
|
|
|
|
this.announcementService.getAnnouncementListService().subscribe((result: any) => {
|
|
|
|
this.announcementService.getAnnouncementListService().subscribe((result: any) => {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
holdData =JSON.parse(result.Mohemm_ITG_ResponseItem) //JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
this.listOfAnnouncement = JSON.parse(holdData.result.data);
|
|
|
|
this.listOfAnnouncement = JSON.parse(holdData.result.data);
|
|
|
|
for (let i = 0; i < this.listOfAnnouncement.length; i++) {
|
|
|
|
for (let i = 0; i < this.listOfAnnouncement.length; i++) {
|
|
|
|
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN.replace(/<\/?[^>]+(>|$)/g, "");
|
|
|
|
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN.replace(/<\/?[^>]+(>|$)/g, "");
|
|
|
|
@ -73,9 +72,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
isopen: false
|
|
|
|
isopen: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(this.listOfAnnouncement);
|
|
|
|
|
|
|
|
this.arrList = this.arr;
|
|
|
|
this.arrList = this.arr;
|
|
|
|
console.log(this.arrList);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|