Elotech-Dev / angular-seed-lazy-aot

2 stars 0 forks source link

When running npm run start I get error: can't resolve (it can't find html file) #7

Closed markoddi01 closed 7 years ago

markoddi01 commented 7 years ago

When running npm run start I get error: can't resolve (it can't find html file)

This is my screen grab:

image

This is my routes:

import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router';

import { HomeRoutes } from './components/home/index'; import { NewJobRoutes } from './components/newJob/index'; import { BlogArticleRoutes } from './components/blogArticle/index'; import { PageNotFoundRoutes } from './components/pageNotFound/index';

@NgModule({ imports: [ RouterModule.forRoot([ ...HomeRoutes,
...NewJobRoutes,
...BlogArticleRoutes, {path: 'invite', loadChildren: 'app/components/invite/invite.module#InviteModule'}, {path: 'socialRegister', loadChildren: 'app/components/socialRegister/socialRegister.module#SocialRegisterModule'}, {path: 'socialRegister/:id', loadChildren: 'app/components/socialRegister/socialRegister.module#SocialRegisterModule'}, {path: 'password', loadChildren: 'app/components/changePassword/changePassword.module#ChangePasswordModule'},
{path: 'email', loadChildren: 'app/components/changeEmail/changeEmail.module#ChangeEmailModule'}, {path: 'company', loadChildren: 'app/components/company/company.module#CompanyModule'}, {path: 'settings', loadChildren: 'app/components/company/company.module#CompanyModule'}, {path: 'profile', loadChildren: 'app/components/profile/profile.module#ProfileModule'}, {path: 'messenger', loadChildren: 'app/components/messenger/messenger.module#MessengerModule'}, {path: 'messenger/:id', loadChildren: 'app/components/messenger/messenger.module#MessengerModule'}, {path: 'messenger/:id/:roomId/:type', loadChildren: 'app/components/messenger/messenger.module#MessengerModule'}, {path: 'jobs', loadChildren: 'app/components/job/jobs.module#JobModule'}, {path: 'createJob', loadChildren: 'app/components/createJob/createJob.module#CreateJobModule'}, {path: 'createJob/:id', loadChildren: 'app/components/createJob/createJob.module#CreateJobModule'}, {path: 'dashboard', loadChildren: 'app/components/dashboard/dashboard.module#DashboardModule'}, {path: 'search', loadChildren: 'app/components/searchJobs/searchJobs.module#SearchJobsModule'}, {path: 'search/:id', loadChildren: 'app/components/searchJobs/searchJobs.module#SearchJobsModule'}, {path: 'messages', loadChildren: 'app/components/messages/messages.module#MessagesModule'}, {path: 'searchTeachers', loadChildren: 'app/components/searchUsers/searchUsers.module#SearchUsersModule'},
{path: 'newJobs', loadChildren: 'app/components/newJobs/newJobs.module#NewJobsModule'}, {path: 'latestJobs', loadChildren: 'app/components/newJobs/newJobs.module#NewJobsModule'},
{path: 'swimJobs', loadChildren: 'app/components/newJobs/newJobs.module#NewJobsModule'},
{path: 'register', loadChildren: 'app/components/register/register.module#RegisterModule'}, {path: 'register/:id', loadChildren: 'app/components/register/register.module#RegisterModule'}, {path: 'help', loadChildren: 'app/components/help/help.module#HelpModule'},
{path: 'applys', loadChildren: 'app/components/userApplications/userApplications.module#UserApplicationsModule'},
{path: 'applications', loadChildren: 'app/components/applications/applications.module#ApplicationsModule'}, {path: 'applications/:id', loadChildren: 'app/components/applications/applications.module#ApplicationsModule'}, {path: 'contact', loadChildren: 'app/components/contact/contact.module#ContactModule'}, {path: 'forgotPassword', loadChildren: 'app/components/forgotPassword/forgotPassword.module#ForgotPasswordModule'}, {path: 'forgotpassword', loadChildren: 'app/components/forgotPassword/forgotPassword.module#ForgotPasswordModule'}, {path: 'login', loadChildren: 'app/components/login/login.module#LoginModule'}, {path: 'blog', loadChildren: 'app/components/blog/blog.module#BlogModule'}, {path: 'privacy', loadChildren: 'app/components/privacy/privacy.module#PrivacyModule'}, {path: 'dbs', loadChildren: 'app/components/dbs/dbs.module#DBSModule'}, {path: 'about', loadChildren: 'app/components/about/about.module#AboutModule'}, {path: '500', loadChildren: 'app/components/500/500.module#Module500'}, {path: '400', loadChildren: 'app/components/400/400.module#Module400'}, {path: '404', loadChildren: 'app/components/404/404.module#Module404'}, {path: 'faq', loadChildren: 'app/components/faq/faq.module#FaqModule'}, {path: 'sitemap', loadChildren: 'app/components/sitemap/sitemap.module#SiteMapModule'}, {path: 'terms', loadChildren: 'app/components/terms/terms.module#TermsModule'}, {path: 'admin', loadChildren: 'app/components/admin/admin.module#AdminModule'},
...PageNotFoundRoutes ]) ], exports: [RouterModule] }) export class AppRoutingModule { }

netstart commented 7 years ago

In the seed https://github.com/mgechev/angular-seed you will reference html temple without ./ in initial like this: https://github.com/mgechev/angular-seed/blob/master/src/client/app/home/home.component.ts

@Component({ moduleId: module.id, selector: 'sd-home', templateUrl: 'home.component.html', styleUrls: ['home.component.css'], }) export class HomeComponent implements OnInit {}

But in our seed, you will write like this: https://github.com/Elotech-Dev/angular-seed-lazy-aot/blob/master/src/app/app.component.ts

@Component({ selector: 'sd-home', templateUrl: './home.component.html', styleUrls: ['./home.component.css'], }) export class HomeComponent implements OnInit {}

markoddi01 commented 7 years ago

Thank you @netstart