<div [innerHTML]="aboutUs?.description"></div>
export class AboutUsComponent {
public aboutUs: About = ABOUT_US_DB[0];
private subReloadOne: Subscription;
constructor(
private _service : AboutUsService,
private reloadService: ReloadService
) {}
ngOnInit() {
this.subReloadOne = this.reloadService.refreshData$.subscribe(async () => {
this._getStaticData();
});
this._getStaticData();
}
private _getStaticData() {
this.aboutUs = this._service.getAboutUs();
console.log("aboutUs", this.aboutUs);
}
ngOnDestroy() {
console.log('Page Destryed----------->');
}
}
export class AboutUsService {
private aboutUs: About[] = ABOUT_US_DB;
constructor(private userService: UserService) {}
/**
getaboutUs()
*/
getAboutUs() {
let Data: About = null;
Data = this.aboutUs?.find(
(f: StaticDataInterface) =>
f?.languageCulture === this.userService.getLanguageCulture()
);
return Data ? Data : null;
}
}
Top comments (0)