My Angular app have some modules, which are loaded lazily. In a component of module A, I'd like to check whether the module is loaded or not before rendering all html tags in the component with *ngIf
. How can I do that? Thank you.
UPDATE 1.
export class CustomerManModule extends AppModuleBase {
constructor(injector: Injector) {
super(injector, AppConsts.module.customerMan);
var localeName = locale();
this.appService.getLanguage(localeName, AppConsts.module.customerMan).subscribe((messages: any) => {
let language = new Object();
language[localeName] = messages;
loadMessages(language);
})
}
}
After I call loadMessages
function, all localization strings will be loaded and I'd like to load these ones only one time when module loaded. After that, all components of that module need to check if those strings are loaded or not to continue rendering.