ii-ngx-common
v1.7.33
Published
Angular 2+ common components, pipes, services, directives
Downloads
392
Readme
NgxCommon
Angular 2+ common components, pipes, services, directives
Installation
- Use npm to install the package
$ npm install ii-ngx-common --save
- You could either add into your module
imports
theNgxCommonModule
in order to add all of the pipes
import { NgxCommonModule } from "ii-ngx-common";
@NgModule({
// ...
imports: [
// ...
NgxCommonModule
]
})
Safe pipe
Marks value that's safe to use as HTML, CSS, Script, etc.........
Usage
<div [innerHTML]="data | safe:'html'">Safe html</div>
<div [innerHTML]="data | safe:'style'">Safe css</div>
<div [innerHTML]="data | safe:'script'">Safe css</div>
<div [innerHTML]="data | safe:'url'">Safe css</div>
<div [innerHTML]="data | safe:'resourceUrl'">Safe css</div>
Unsubscribe service
Observable service which is unsubscribed after service is destroyed.
Usage
import {UnsubscribeService} from "ii-ngx-common";
@Component({
...
providers: [UnsubscribeService]
})
export class MyComponent {
constructor(unsubscribeService$: UnsubscribeService) {
someObservable.pipe(
takeUntil(unsubscribeService$)
).subscribe(() => {
...
});
}
}