@premotec/ngx-essentials v6.2.0
Table of Contents
##Installation
First you need to install the npm module:
npm i @premotec/ngx-essentials --save
##Usage
- Add NgxEssentials into your SharedModule class. Don't forget to add NgxEssentialsModule to the exports array. Shared.module.ts would look like this:
import {NgModule} from '@angular/core';
import {NgxEssentialsModule} from '@premotec/ngx-essentials/';
@NgModule({
imports: [NgxEssentialsModule],
exports: [NgxEssentialsModule]
})
export class SharedModule {
}
Then import SharedModule everywhere you need the LoadingIndicatorComponent or ConfirmationModalComponent.
- Provide singleton services and interceptors in your AppModule or CoreModule class. The import of TimeStampInterceptor in your core.module.ts would look like this.
import { NgModule, ModuleWithProviders, Optional, SkipSelf, LOCALE_ID } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import { TimeStampInterceptor } from '@premotec/ngx-essentials';
@NgModule({
imports: [
CommonModule,
]
})
export class CoreModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: CoreModule,
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: TimeStampInterceptor,
multi: true
},
],
};
}
constructor (@Optional() @SkipSelf() parentModule: CoreModule) {
if (parentModule) {
throw new Error(
'CoreModule is already loaded. Import it in the AppModule only');
}
}
}
API
Type | Name | Description |
---|---|---|
Component | BaseComponent | Base component to use that helps handle cleaning up of ressources |
Component | LoadingIndicatorComponent | Provides a loading indicator. Just embed into your html template file to use it. |
Class | ObjectHelper | Helper for mapping and navigating on properties. |
Directive | AutoWindowHeightDirective | Directive to adapt the height of an element to the height of the window. |
Interceptor | TimeStampInterceptor | Interceptor which adds a timestamp to http requests in order to avoid browser caching. Import it to your application as descripted here |
Model | WebAppInfoModel | Model for WebAppAssembly-API |
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago