RC5 NgModules declarations
<p>After upgrading angular 2 to RC5, i was getting warnings like below asking me to move my components to module declarations:</p>

<blockquote>
  <p>NgModule AppModule uses AcademylistComponent via "entryComponents" but
  it was neither declared nor imported! This warning will become an
  error after final.</p>
</blockquote>

<p>I was refering to these components in my router config file. What looked like this:</p>

<pre><code>import {provideRouter,RouterConfig} from '@angular/router';
import {AcademylistComponent} from '../modules/home/component/academyList.component';
import {CourselistComponent} from '../modules/home/component/courseList.component';
import {CreateacademyComponent} from '../modules/home/component/createAcademy.component';
import {ReportsComponent} from '../modules/home/component/reports.component';
import {AuthenticatedGuard} from '../guards/authenticated.guard';

export const routes: RouterConfig = [
{
    path: '',
    redirectTo:'/home',
    terminal:true},
{
    path: 'home',
    canActivate: [AuthenticatedGuard],
    children: [

        {path: '', component: AcademylistComponent},
        {path: 'my-academies', component: AcademylistComponent},
        {path: 'my-courses', component: CourselistComponent},
        {path: 'create-academy', component: CreateacademyComponent},
        {path: 'reports', component: ReportsComponent}

    ]

}

];

export const APP_ROUTER_PROVIDERS = [
provideRouter(routes)
];
</code></pre>

<p>When i moved the components to ng module's <code>declarations</code> array and imported them there, the routes config file did started giving me <code>Cannot find name</code> errors.</p>

<p>So how do i use module declarations in this case? </p>