title: Angular 2 error when declaring custom pipe on AppModule
body: <p>I am trying to create a custom pipe that takes a number and displays an empty screen if equal to a value passed as parameter. I created the pipe file by copy + pasting the Tour of Heroes example, and then added the pipe on the declarations array of AppModule, as the ToH mentioned. However, when I run the code, I get an error before page loads, saying </p>
  
  <blockquote>
    <p>"metadata_resolver.js:275 Uncaught Error: Unexpected value
    'BlankIfPipe' declared by the module 'AppModule"</p>
  </blockquote>
  
  <p>I am using Angular version 2.0.2. If I update to 2.1 I get all sorts of errors.</p>
  
  <p>Here is my pipe (although it does not seem to be caused by it as the declarations array throws the error):</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  
  Pipe({ name: 'blankIf' })
  export class BlankIfPipe implements PipeTransform {
      transform(value: number, replaceIf: number): string {
          return value === replaceIf ? '' : value.toString();
      }
  }
  </code></pre>
  
  <p>the AppModule has this (some imports where removed):</p>
  
  <pre><code>import { LabTestService } from './lab-test/lab-test.service';
  import { BlankIfPipe } from './blank-if.pipe';
  
  @NgModule({
      declarations: [
          AppComponent,
          BlankIfPipe
      ],
      imports: [
          NgbModule.forRoot(),
          BrowserModule,
          FormsModule,
          CoreModule,
          LabTestModule
      ],
      providers: [ LabTestService ], // should this be moved to LabTestModule?
      bootstrap: [ AppComponent ]
  })
  export class AppModule { }
  </code></pre>