Snippets Collections
<p>{{ lesson?.description | replaceHtmlTags }}</p>
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({ name: 'replaceHtmlTags' })
export class ReplaceHtmlTagsPipe implements PipeTransform {
  transform(html: string): string {
    return html.replace(/<\/?[^>]+(>|$)/g, '');
  }
}
@NgModule({
  declarations: [ReplaceHtmlTagsPipe],
  // ...
})
export class AppModule { }
const pipe = (...ops) => {
  const _pipe = (a, b) => (arg) => b(a(arg));
  let bundle = ops.reduce((prevOp, nextOp) => {
    return _pipe(prevOp,nextOp);
  });
  return bundle;
}
star

Fri Apr 14 2023 09:53:55 GMT+0000 (Coordinated Universal Time)

#angular #pipe
star

Sun Dec 26 2021 19:54:30 GMT+0000 (Coordinated Universal Time) undefined

#javascript #pipe #function

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension