npm install @baloise/web-app-pipes-angular
Add the pipe module to your app module.
import { NgModule } from '@angular/core'
import { BaloisePipeModule } from '@baloise/@baloise/web-app-pipes-angular'
import { AppComponent } from './app.component'
@NgModule({
declarations: [AppComponent],
imports: [BaloisePipeModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
The pipe functions are defined as Angular Pipes.
<span>{{ 'baloise' | balCapitalize }}</span>
The can be used in the component typescript file aswell.
import { Component } from '@angular/core'
import { balCapitalize } from '@baloise/web-app-pipes-angular'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
capitalize(value: string) {
return balCapitalize(value)
}
}