How to create and call a pipe from the component in Angular 2?

后端 未结 5 753
臣服心动
臣服心动 2020-12-17 15:03

I want to create a dynamic pipe which I am going to call from the component.

import {Component, Pipe, PipeTransform} from \'angular2/core\';

@Pipe({ name: \         


        
5条回答
  •  一生所求
    2020-12-17 15:34

    In version rc6 you need to register the pipes you want to use in a module -> declarations

    @NgModule({
        declarations: [
            AppComponent ,
            filter
        ]....
    

提交回复
热议问题