title: How can I centrally import a TypeScript class into an Angular Module?
body: <p>Is there a recommended method for importing TypeScript classes into an Angular Module so that every Component or Service in that Module inherits those definitions?</p>
  
  <p>The core issue is <strong>"why doesn't a class imported into a module get automatically imported into the other components in that module?"</strong></p>
  
  <p>I have tried importing a class into the module like this:</p>
  
  <p>registration.model.ts:</p>
  
  <pre><code>export class Event {
    id: string;
    name: string;
  }
  </code></pre>
  
  <p>registration.module.ts:</p>
  
  <pre><code>import { Event } from './registration.model';
  </code></pre>
  
  <p>I have also added it to the declarations in the Module with no effect (I removed this from the declarations array as soon as I figured out it did nothing):</p>
  
  <pre><code>declarations: [
      Event,
      ...
  ]
  </code></pre>
  
  <p>registration.service.ts:</p>
  
  <pre><code>getEvents(): Observable&lt;Event[]&gt; {
  
    return this.http.get(`api/events`)
      .map(response =&gt; response.json());
  
  }
  </code></pre>
  
  <p>Produces this error and the app fails to compile:</p>
  
  <blockquote>
    <p>ERROR in
    C:/code/registration/src/app/registration/registration.service.ts
    (26,29): Cannot find name 'Event'.</p>
  </blockquote>
  
  <p>If I add the import directly into registration.service.ts then the error goes away and everything compiles properly:</p>
  
  <pre><code>import { Event } from './registration.model';
  </code></pre>
  
  <p>I have verified that the relative path is correct in the Module.  I can change it to an absolute path in the Module and will I get the same error in the service.</p>
  
  <p><strong>Follow-Up Edit</strong>
  Thanks to Adrian's response I understand this a lot better now.  I also found out that you can import several classes at once from a TypeScript module as follows:</p>
  
  <pre><code>import * as Registration from 'app/models/registration.model'; 
  </code></pre>