@ngx-armory/pipes
v0.0.4
Published
<h1 align="center">Ngx Armory - Pipes</h1>
Downloads
6
Readme
Table of contents
Installation
- Use npm to install the package
$ npm install @ngx-armory/pipes --save
- You could add to your standalone component or module a specific pipe such as
IsNullPipe
.
import {IsNullPipe} from '@ngx-armory/pipes';
@NgModule({
// ...
imports: [
// ...
IsNullPipe
]
})
import { IsNullPipe } from '@ngx-armory/pipes';
@Component({
// ..
standalone: true,
imports: [IsNullPipe],
})
export class AppComponent {}
- Pipes are also injectable and can be used in Components / Services / etc..
import { IsNullPipe } from '@ngx-armory/pipes';
@Component({
// ..
providers: [IsNullPipe],
})
export class AppComponent {
constructor(private isNullPipe: IsNullPipe) {
const nullable = null;
this.isNullPipe.transform(nullable); // Returns: true
}
// ..
}
- You can also use pipes as part of your template for ex.
<p>{{ "foo" | isNull }}</p>
<!-- Output: false -->
This library was generated with Nx.