My routing module don't find my component
I'm trying to apply lazy loading in my application, but i receive:
Uncaught Error: Component CustofixoComponent is not part of any
NgModule or the module has not been imported into your module.
custofixo.module.ts:
import { DialogConfirmacaoExclusaoModule } from './../../dialogexclusao/dialog-confirmacao-exclusao.module';
//Importação de módulos angular
import { MyMaterialDesignModule } from '../../../app.materialdesign.module';
import { MatMenuModule } from '@angular/material/menu';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgxCurrencyModule } from "ngx-currency";
import { ReactiveFormsModule } from '@angular/forms';
import { LoadingModule } from '../../loading/loading.module';
import { NgxMaskModule } from 'ngx-mask'
import { MostraToastService } from '../../../services/mostratoast.service';
import { CustoFixoRoutingModule } from './custofixo.routing.module';
//Importação de componentes do módulo
import { CustofixoComponent } from './custofixo.component';
import { MatTooltipModule } from '@angular/material';
import { CustosService } from '../../../services/custos.service';
import { DialogConfirmacaoExclusao } from '../../dialogexclusao/dialog-exclusao.component';
import { AuthService } from '../../../services/auth.service';
import { svgInfoManModule } from '../../svgInfoMan/svgInfoMan.module';
@NgModule({
imports: [
CustoFixoRoutingModule,
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
],
exports:[
CustofixoComponent
],
declarations: [CustofixoComponent],
entryComponents:[DialogConfirmacaoExclusao],
providers:[
CustosService,
MostraToastService,
AuthService
]
})
export class CustoFixoModule { }
custofixo.routing.ts: the error is generated in this file. I don't know why my routing don't find my component.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '', component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule {}
In my root routes:
const dashboardRoutes: Routes = [
{path: 'dash', component: DashboardComponent, canActivate: [AuthGuard],
children: [
{ path: '', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'home', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'custofixo', loadChildren: 'src/app/components/dashboard/custofixo/custofixo.module#CustoFixoModule' }
The bemvindomodule works well, but my custoFixoModule have a similar code and don't work.
Restart ng server still don't work
angular typescript
|
show 8 more comments
I'm trying to apply lazy loading in my application, but i receive:
Uncaught Error: Component CustofixoComponent is not part of any
NgModule or the module has not been imported into your module.
custofixo.module.ts:
import { DialogConfirmacaoExclusaoModule } from './../../dialogexclusao/dialog-confirmacao-exclusao.module';
//Importação de módulos angular
import { MyMaterialDesignModule } from '../../../app.materialdesign.module';
import { MatMenuModule } from '@angular/material/menu';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgxCurrencyModule } from "ngx-currency";
import { ReactiveFormsModule } from '@angular/forms';
import { LoadingModule } from '../../loading/loading.module';
import { NgxMaskModule } from 'ngx-mask'
import { MostraToastService } from '../../../services/mostratoast.service';
import { CustoFixoRoutingModule } from './custofixo.routing.module';
//Importação de componentes do módulo
import { CustofixoComponent } from './custofixo.component';
import { MatTooltipModule } from '@angular/material';
import { CustosService } from '../../../services/custos.service';
import { DialogConfirmacaoExclusao } from '../../dialogexclusao/dialog-exclusao.component';
import { AuthService } from '../../../services/auth.service';
import { svgInfoManModule } from '../../svgInfoMan/svgInfoMan.module';
@NgModule({
imports: [
CustoFixoRoutingModule,
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
],
exports:[
CustofixoComponent
],
declarations: [CustofixoComponent],
entryComponents:[DialogConfirmacaoExclusao],
providers:[
CustosService,
MostraToastService,
AuthService
]
})
export class CustoFixoModule { }
custofixo.routing.ts: the error is generated in this file. I don't know why my routing don't find my component.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '', component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule {}
In my root routes:
const dashboardRoutes: Routes = [
{path: 'dash', component: DashboardComponent, canActivate: [AuthGuard],
children: [
{ path: '', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'home', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'custofixo', loadChildren: 'src/app/components/dashboard/custofixo/custofixo.module#CustoFixoModule' }
The bemvindomodule works well, but my custoFixoModule have a similar code and don't work.
Restart ng server still don't work
angular typescript
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
something like this:{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }
– ashish pal
Nov 22 '18 at 12:46
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48
|
show 8 more comments
I'm trying to apply lazy loading in my application, but i receive:
Uncaught Error: Component CustofixoComponent is not part of any
NgModule or the module has not been imported into your module.
custofixo.module.ts:
import { DialogConfirmacaoExclusaoModule } from './../../dialogexclusao/dialog-confirmacao-exclusao.module';
//Importação de módulos angular
import { MyMaterialDesignModule } from '../../../app.materialdesign.module';
import { MatMenuModule } from '@angular/material/menu';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgxCurrencyModule } from "ngx-currency";
import { ReactiveFormsModule } from '@angular/forms';
import { LoadingModule } from '../../loading/loading.module';
import { NgxMaskModule } from 'ngx-mask'
import { MostraToastService } from '../../../services/mostratoast.service';
import { CustoFixoRoutingModule } from './custofixo.routing.module';
//Importação de componentes do módulo
import { CustofixoComponent } from './custofixo.component';
import { MatTooltipModule } from '@angular/material';
import { CustosService } from '../../../services/custos.service';
import { DialogConfirmacaoExclusao } from '../../dialogexclusao/dialog-exclusao.component';
import { AuthService } from '../../../services/auth.service';
import { svgInfoManModule } from '../../svgInfoMan/svgInfoMan.module';
@NgModule({
imports: [
CustoFixoRoutingModule,
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
],
exports:[
CustofixoComponent
],
declarations: [CustofixoComponent],
entryComponents:[DialogConfirmacaoExclusao],
providers:[
CustosService,
MostraToastService,
AuthService
]
})
export class CustoFixoModule { }
custofixo.routing.ts: the error is generated in this file. I don't know why my routing don't find my component.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '', component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule {}
In my root routes:
const dashboardRoutes: Routes = [
{path: 'dash', component: DashboardComponent, canActivate: [AuthGuard],
children: [
{ path: '', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'home', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'custofixo', loadChildren: 'src/app/components/dashboard/custofixo/custofixo.module#CustoFixoModule' }
The bemvindomodule works well, but my custoFixoModule have a similar code and don't work.
Restart ng server still don't work
angular typescript
I'm trying to apply lazy loading in my application, but i receive:
Uncaught Error: Component CustofixoComponent is not part of any
NgModule or the module has not been imported into your module.
custofixo.module.ts:
import { DialogConfirmacaoExclusaoModule } from './../../dialogexclusao/dialog-confirmacao-exclusao.module';
//Importação de módulos angular
import { MyMaterialDesignModule } from '../../../app.materialdesign.module';
import { MatMenuModule } from '@angular/material/menu';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgxCurrencyModule } from "ngx-currency";
import { ReactiveFormsModule } from '@angular/forms';
import { LoadingModule } from '../../loading/loading.module';
import { NgxMaskModule } from 'ngx-mask'
import { MostraToastService } from '../../../services/mostratoast.service';
import { CustoFixoRoutingModule } from './custofixo.routing.module';
//Importação de componentes do módulo
import { CustofixoComponent } from './custofixo.component';
import { MatTooltipModule } from '@angular/material';
import { CustosService } from '../../../services/custos.service';
import { DialogConfirmacaoExclusao } from '../../dialogexclusao/dialog-exclusao.component';
import { AuthService } from '../../../services/auth.service';
import { svgInfoManModule } from '../../svgInfoMan/svgInfoMan.module';
@NgModule({
imports: [
CustoFixoRoutingModule,
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
],
exports:[
CustofixoComponent
],
declarations: [CustofixoComponent],
entryComponents:[DialogConfirmacaoExclusao],
providers:[
CustosService,
MostraToastService,
AuthService
]
})
export class CustoFixoModule { }
custofixo.routing.ts: the error is generated in this file. I don't know why my routing don't find my component.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '', component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule {}
In my root routes:
const dashboardRoutes: Routes = [
{path: 'dash', component: DashboardComponent, canActivate: [AuthGuard],
children: [
{ path: '', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'home', loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' },
{ path: 'custofixo', loadChildren: 'src/app/components/dashboard/custofixo/custofixo.module#CustoFixoModule' }
The bemvindomodule works well, but my custoFixoModule have a similar code and don't work.
Restart ng server still don't work
angular typescript
angular typescript
edited Nov 22 '18 at 12:41
Renato Veronese
asked Nov 22 '18 at 12:30
Renato VeroneseRenato Veronese
4211
4211
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
something like this:{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }
– ashish pal
Nov 22 '18 at 12:46
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48
|
show 8 more comments
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
something like this:{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }
– ashish pal
Nov 22 '18 at 12:46
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
something like this:
{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }– ashish pal
Nov 22 '18 at 12:46
something like this:
{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }– ashish pal
Nov 22 '18 at 12:46
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48
|
show 8 more comments
4 Answers
4
active
oldest
votes
It seems you have not declared the component CustofixoComponent anywhere. You need to add it in the declarations array of the CustoFixoModule.
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
add a comment |
There are two workarounds
try to break serve and rerun because sometimes cli don't detect the files
OR
imports: [
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
CustoFixoRoutingModule, <--- here
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
]
I have read somewhere that order will considered on building the angular app
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
add a comment |
Please check the updated custofixo.routing.ts file from which the error is thrown:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '',
pathMatch: 'full', // <-- Add pathMatch and check again
component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule { }
For more details, please check here
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add a comment |
You cannot import lazy loaded module into another module. You can move the component to shared module and import that module in lazyloaded modules
AppModule
SharedModule
LazyLoadedModule1 - SharedModule
LazyLoadedModule2 - SharedModule
LazyLoadedModule3 - SharedModule
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431076%2fmy-routing-module-dont-find-my-component%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems you have not declared the component CustofixoComponent anywhere. You need to add it in the declarations array of the CustoFixoModule.
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
add a comment |
It seems you have not declared the component CustofixoComponent anywhere. You need to add it in the declarations array of the CustoFixoModule.
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
add a comment |
It seems you have not declared the component CustofixoComponent anywhere. You need to add it in the declarations array of the CustoFixoModule.
It seems you have not declared the component CustofixoComponent anywhere. You need to add it in the declarations array of the CustoFixoModule.
answered Nov 22 '18 at 12:36
Sachin GuptaSachin Gupta
715412
715412
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
add a comment |
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
In my CustoFixoModule i already do this. look my code. declarations: [CustofixoComponent],
– Renato Veronese
Nov 22 '18 at 12:39
1
1
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
it is already declared thats not an issue
– Sheik Althaf
Nov 22 '18 at 12:39
add a comment |
There are two workarounds
try to break serve and rerun because sometimes cli don't detect the files
OR
imports: [
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
CustoFixoRoutingModule, <--- here
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
]
I have read somewhere that order will considered on building the angular app
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
add a comment |
There are two workarounds
try to break serve and rerun because sometimes cli don't detect the files
OR
imports: [
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
CustoFixoRoutingModule, <--- here
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
]
I have read somewhere that order will considered on building the angular app
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
add a comment |
There are two workarounds
try to break serve and rerun because sometimes cli don't detect the files
OR
imports: [
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
CustoFixoRoutingModule, <--- here
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
]
I have read somewhere that order will considered on building the angular app
There are two workarounds
try to break serve and rerun because sometimes cli don't detect the files
OR
imports: [
CommonModule,
FormsModule,
LoadingModule,
MyMaterialDesignModule,
CustoFixoRoutingModule, <--- here
HttpClientModule,
MatMenuModule,
MatTooltipModule,
ReactiveFormsModule,
DialogConfirmacaoExclusaoModule,
NgxCurrencyModule,
NgxMaskModule,
svgInfoManModule,
]
I have read somewhere that order will considered on building the angular app
answered Nov 22 '18 at 12:44
Sheik AlthafSheik Althaf
27717
27717
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
add a comment |
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
Changed the order and restart ngserve, but i still receive the warning
– Renato Veronese
Nov 22 '18 at 12:46
add a comment |
Please check the updated custofixo.routing.ts file from which the error is thrown:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '',
pathMatch: 'full', // <-- Add pathMatch and check again
component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule { }
For more details, please check here
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add a comment |
Please check the updated custofixo.routing.ts file from which the error is thrown:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '',
pathMatch: 'full', // <-- Add pathMatch and check again
component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule { }
For more details, please check here
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add a comment |
Please check the updated custofixo.routing.ts file from which the error is thrown:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '',
pathMatch: 'full', // <-- Add pathMatch and check again
component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule { }
For more details, please check here
Please check the updated custofixo.routing.ts file from which the error is thrown:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CustofixoComponent } from './custofixo.component';
const custoFixoRoutes: Routes = [
{
path: '',
pathMatch: 'full', // <-- Add pathMatch and check again
component: CustofixoComponent
}
];
@NgModule({
imports: [RouterModule.forChild(custoFixoRoutes)],
exports: [RouterModule]
})
export class CustoFixoRoutingModule { }
For more details, please check here
edited Nov 22 '18 at 13:06
answered Nov 22 '18 at 13:00
Niral MunjariyaNiral Munjariya
782520
782520
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add a comment |
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add pathmatch but still have message error
– Renato Veronese
Nov 22 '18 at 14:03
add a comment |
You cannot import lazy loaded module into another module. You can move the component to shared module and import that module in lazyloaded modules
AppModule
SharedModule
LazyLoadedModule1 - SharedModule
LazyLoadedModule2 - SharedModule
LazyLoadedModule3 - SharedModule
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
add a comment |
You cannot import lazy loaded module into another module. You can move the component to shared module and import that module in lazyloaded modules
AppModule
SharedModule
LazyLoadedModule1 - SharedModule
LazyLoadedModule2 - SharedModule
LazyLoadedModule3 - SharedModule
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
add a comment |
You cannot import lazy loaded module into another module. You can move the component to shared module and import that module in lazyloaded modules
AppModule
SharedModule
LazyLoadedModule1 - SharedModule
LazyLoadedModule2 - SharedModule
LazyLoadedModule3 - SharedModule
You cannot import lazy loaded module into another module. You can move the component to shared module and import that module in lazyloaded modules
AppModule
SharedModule
LazyLoadedModule1 - SharedModule
LazyLoadedModule2 - SharedModule
LazyLoadedModule3 - SharedModule
answered Nov 22 '18 at 13:11
Suresh Kumar AriyaSuresh Kumar Ariya
4,5161215
4,5161215
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
add a comment |
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
i will try this later...
– Renato Veronese
Nov 22 '18 at 14:59
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
Ok. please update me the outcome.
– Suresh Kumar Ariya
Nov 22 '18 at 16:42
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
I'm not importing lazy loading modules in other modules.
– Renato Veronese
Dec 3 '18 at 12:17
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431076%2fmy-routing-module-dont-find-my-component%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
add component name also in children array with path and loadChildren
– ashish pal
Nov 22 '18 at 12:41
@ashishpal you can put a example?
– Renato Veronese
Nov 22 '18 at 12:42
something like this:
{ path: ' ',component: CustofixoComponent, loadChildren: 'src/app/components/dashboard/bemvindo/bemvindo.module#BemVindoModule' }– ashish pal
Nov 22 '18 at 12:46
Did you import the custofixo.module in the main module?
– itsundefined
Nov 22 '18 at 12:48
@itsundefined no
– Renato Veronese
Nov 22 '18 at 12:48