Angular Custom Pipe with parameter

summary.pip.ts

import {Pipe, PipeTransform} from "@angular/core";

@Pipe({
  name: 'summary'
})
export class SummaryPip implements PipeTransform {

  transform(value: string, limit?: number): any {
    if (!value) {
      return null;
    }

    let actualLimit = (limit) ? limit : 50;

    return value.substr(0, actualLimit) + "...";
  }

}

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';


import { AppComponent } from './app.component';
import {SummaryPip} from "./summary.pip";


@NgModule({
  declarations: [
    AppComponent,
    SummaryPip
  ],
  imports: [
    BrowserModule,
  ],
  providers: [
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

how to use

{{post.text | summary:15}}