title: How can I properly import a Pipe Module in my Component in Angular 4/Ionic?
body: <p>So I am getting this error:</p>
  
  <pre><code>Template parse errors: The pipe 'orderByDateSubmitted' could not be found.
  </code></pre>
  
  <p>Any my code looks like this:</p>
  
  <p>First, I created a Pipe:</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  
  @Pipe({
    name: 'orderByDateSubmitted'
  })
  
  export class OrderByDateSubmittedPipe implements PipeTransform {
  
    transform(array: Array&lt;any&gt;, args: string): Array&lt;any&gt; {
      //sort code
    }
  }
  </code></pre>
  
  <p>and then I created a Module for this:</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { CommonModule } from "@angular/common";
  import { OrderByDateSubmittedPipe } from './order-by-date-submitted';
  
  @NgModule({
    imports: [CommonModule],
    declarations: [OrderByDateSubmittedPipe],
    exports: [OrderByDateSubmittedPipe],
  })
  
  export class OrderByDateSubmittedPipeModule {}
  </code></pre>
  
  <p>And in my App Module</p>
  
  <pre><code>import { OrderByDateSubmittedPipe } from './../pipes/order-by-date-submitted/order-by-date-submitted';
  import { OrderByDateSubmittedPipeModule } from './../pipes/order-by-date-submitted/order-by-date-submitted.module';
  
  @NgModule({
    declarations: [MyApp...],
    imports: [...
      OrderByDateSubmittedPipeModule
    ],
    bootstrap: [IonicApp],
    entryComponents: [...],
    providers: [...]
  })
  export class AppModule {}
  </code></pre>
  
  <p>and I use it in one of my components like this:</p>
  
  <pre><code>*ngFor="let r of reports | orderByDateSubmitted: '-date_submitted'"
  </code></pre>
  
  <p>But I'm getting that error. Did I actually do the importing of modules correctly? Or am I missing something? Any help would be much appreciated.</p>