ERROR in No NgModule metadata found for Module ('DeviceProfileConfigurationModule')











up vote
0
down vote

favorite
1












Cmd Output of ng serve




Date: 2018-11-19T11:53:47.208Z

Hash: 8b2719588798f3cae7c5

Time: 17051ms

chunk {main} main.js, main.js.map (main) 1.84 kB [initial] [rendered]

chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.3 kB [initial] [rendered]

chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]

chunk {scripts} scripts.js, scripts.js.map (scripts) 1.08 MB [rendered]

chunk {styles} styles.js, styles.js.map (styles) 1.73 MB [initial] [rendered]

chunk {vendor} vendor.js, vendor.js.map (vendor) 318 kB [initial] [rendered]



ERROR in No NgModule metadata found for 'DeviceProfileConfigurationModule'.  
i 「wdm」: Failed to compile.



Getting above error after updating angular app from angular 4 to angular 7 or 6 i tried below steps but not working. Any other solution please ?



npm cache clean --force

npm install

npm install --save-dev @angular/cli@latest


please check files



> Package.json file



{
"name": "asset-web",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^7.0.4",
"@angular/cdk": "^7.0.4",
"@angular/common": "^7.0.4",
"@angular/compiler": "^7.0.4",
"@angular/core": "^7.0.4",
"@angular/forms": "^7.0.4",
"@angular/http": "^7.0.4",
"@angular/material": "^7.0.4",
"@angular/platform-browser": "^7.0.4",
"@angular/platform-browser-dynamic": "^7.0.4",
"@angular/router": "^7.0.4",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
"@swimlane/ngx-charts": "^10.0.0",
"@swimlane/ngx-datatable": "10.2.3",
"@types/file-saver": "0.0.1",
"@types/googlemaps": "^3.30.16",
"@types/xlsx": "0.0.36",
"agm-core": "^1.0.0-beta.5",
"angular-2-dropdown-multiselect": "^1.8.1",
"angular-calendar": "^0.26.4",
"angular-in-memory-web-api": "^0.7.0",
"angular-resizable-element": "^3.2.2",
"angular-tree-component": "^7.2.1",
"angular2-datetimepicker": "^1.1.1",
"angular2-google-map": "^0.1.8",
"angular2-permission": "^0.1.3",
"bootstrap": "^4.1.3",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.7",
"crypto-js": "^3.1.9-1",
"d3": "4.10.2",
"d3-array": "^2.0.2",
"d3-hierarchy": "1.1.5",
"export-to-csv": "^0.1.2",
"file-saver": "^1.3.8",
"flag-icon-css": "2.9.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"jquery": "^3.3.1",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"leaflet-map": "0.2.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"ng-click-outside": "^2.4.1",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-ckeditor": "^1.2.2",
"ng2-completer": "1.6.3",
"ng2-cookies": "^1.0.12",
"ng2-daterangepicker": "^2.0.10",
"ng2-dragula": "1.5.0",
"ng2-popover": "0.0.14",
"ng2-smart-table": "^1.3.5",
"ng2-stomp-service": "^1.2.2",
"ng2-validation": "4.2.0",
"ngc-webpack": "^4.1.2",
"ngx-bootstrap": "^2.0.5",
"ngx-carousel": "^1.3.5",
"ngx-color-picker": "^4.5.3",
"ngx-datetime-picker": "^2.0.0",
"ngx-file-drop": "^1.0.13",
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mydatepicker": "^2.4.9",
"ngx-pagination": "3.0.3",
"ngx-perfect-scrollbar": "4.9.6",
"ngx-popover": "0.0.16",
"ngx-toastr": "^9.1.1",
"ngx-treeview": "^6.0.2",
"popper.js": "^1.14.5",
"primeng": "^4.3.0",
"rxjs": "^6.3.3",
"sockjs-client": "^1.3.0",
"stompjs": "^2.3.3",
"ts-xlsx": "0.0.11",
"tslib": "^1.9.3",
"web-animations-js": "2.3.1",
"widgster": "1.0.0",
"xlsx": "^0.11.19",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.10.6",
"@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.0.4",
"@angular/language-service": "^5.2.11",
"@types/jasmine": "^2.8.12",
"@types/jasminewd2": "^2.0.6",
"@types/jquery": "^3.3.22",
"@types/lodash": "^4.14.118",
"@types/node": "^6.14.2",
"codelyzer": "^4.5.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "^3.1.6"
}
}


> My Approutes.ts file



import { AuthGuard } from './guards/auth.guard';
import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import { LoginComponent } from './pages/login/login/login.component';
import { AuthenticatedComponent } from './authenticated/authenticated.component';
import { MainComponent } from './common/main/main.component';
import { UserTrackingComponent } from './pages/user-tracking/user-tracking.component';
import { MapComponent } from './pages/customerconfiguration/map/map.component';
import { IPermissionGuardModel, PermissionGuard } from '../../node_modules/angular2-permission';
import { UsermasterComponent } from './pages/customerconfiguration/usermaster/usermaster.component';
import { DeviceInventorySidebarComponent } from './pages/inventory/device-inventory-sidebar/device-inventory-sidebar.component';
import { GroupComponent } from './pages/group-definition/group/group.component';
import { GroupDefinitionComponent } from './pages/group-definition/group-definition/group-definition.component';
import { DeviceProfileComponent } from './pages/device-profile/device-profile/device-profile.component';
import { AlertManagementSidebarComponent } from './pages/alert/alert-management-sidebar/alert-management-sidebar.component';
export const AppRoutes: Routes = [
{
path: "",
canActivate: [AuthGuard],
component: AuthenticatedComponent,
children: [
{
path: "",
component: MainComponent,
loadChildren: "./pages/dashboard.module#DashboardModule",
},

{
path: 'profileconfiguration',
pathMatch: "full",
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile-configuration/device-profile-configuration.module#DeviceProfileConfigurationModule'

},



{
path: 'profile',
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile/device-profile.module#DeviceProfileModule'
},


]

},
{
path: "login",
component: LoginComponent
},
{
redirectTo: "",
path: "**",
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(AppRoutes, {
preloadingStrategy: PreloadAllModules,
});



DeviceProfileConfiguration file




import { AuthGuard } from "../../guards/auth.guard";
import { PermissionGuard, IPermissionGuardModel } from "../../../../node_modules/angular2-permission";
import { LoraComponent } from "./lora/lora.component";
import { HrComponent } from "./hr/hr.component";
import { SkinTempComponent } from "./skin-temp/skin-temp.component";
import { FallComponent } from "./fall/fall.component";
import { BatteryComponent } from "./battery/battery.component";
import { NgModule, ModuleWithProviders } from "../../../../node_modules/@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from "@angular/router";
import { DeviceProfileConfigurationComponent } from "./device-profile-configuration/device-profile-configuration.component";
import { Common_Module } from "../../common/common-module";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule, MatDialogModule, MatSidenavModule, MatStepperModule, MatSelectModule, MatTooltipModule, MatSlideToggleModule } from "@angular/material";

export const routes = [
{
path: "",
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileConfigurationComponent,
redirectTo: "lora/add",pathMatch: 'full'
},
{
path: "hr",
redirectTo: "hr/add",
pathMatch: 'full'
}, {
path: 'hr/:action',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'hr/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "st",
redirectTo: "st/add",
pathMatch: 'full'
}, {
path: 'st/:action',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'st/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "fall",
redirectTo: "fall/add",
pathMatch: 'full'
}, {
path: 'fall/:action',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'fall/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "battery",
redirectTo: "battery/add",
pathMatch: 'full'
}, {
path: 'battery/:action',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'battery/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}
];

export const DeviceProfileConfigRouter:ModuleWithProviders = RouterModule.forChild(routes);

@NgModule({
imports:[
CommonModule,
Common_Module,
ReactiveFormsModule,
FormsModule,
BrowserModule,
BrowserAnimationsModule,
MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule,
MatDialogModule, MatSidenavModule, MatSelectModule, MatDialogModule, MatStepperModule, MatTooltipModule, MatSlideToggleModule,
RouterModule.forChild(routes)
],
declarations:[
LoraComponent,
HrComponent,
BatteryComponent,
FallComponent,
FallComponent,
SkinTempComponent,

]
})

export class DeviceProfileConfigurationModule{}









share|improve this question
























  • plz provide your tx code
    – federico scamuzzi
    Nov 19 at 12:04










  • hello @federicoscamuzzi please check the updated question
    – moreshwar
    Nov 19 at 12:27















up vote
0
down vote

favorite
1












Cmd Output of ng serve




Date: 2018-11-19T11:53:47.208Z

Hash: 8b2719588798f3cae7c5

Time: 17051ms

chunk {main} main.js, main.js.map (main) 1.84 kB [initial] [rendered]

chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.3 kB [initial] [rendered]

chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]

chunk {scripts} scripts.js, scripts.js.map (scripts) 1.08 MB [rendered]

chunk {styles} styles.js, styles.js.map (styles) 1.73 MB [initial] [rendered]

chunk {vendor} vendor.js, vendor.js.map (vendor) 318 kB [initial] [rendered]



ERROR in No NgModule metadata found for 'DeviceProfileConfigurationModule'.  
i 「wdm」: Failed to compile.



Getting above error after updating angular app from angular 4 to angular 7 or 6 i tried below steps but not working. Any other solution please ?



npm cache clean --force

npm install

npm install --save-dev @angular/cli@latest


please check files



> Package.json file



{
"name": "asset-web",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^7.0.4",
"@angular/cdk": "^7.0.4",
"@angular/common": "^7.0.4",
"@angular/compiler": "^7.0.4",
"@angular/core": "^7.0.4",
"@angular/forms": "^7.0.4",
"@angular/http": "^7.0.4",
"@angular/material": "^7.0.4",
"@angular/platform-browser": "^7.0.4",
"@angular/platform-browser-dynamic": "^7.0.4",
"@angular/router": "^7.0.4",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
"@swimlane/ngx-charts": "^10.0.0",
"@swimlane/ngx-datatable": "10.2.3",
"@types/file-saver": "0.0.1",
"@types/googlemaps": "^3.30.16",
"@types/xlsx": "0.0.36",
"agm-core": "^1.0.0-beta.5",
"angular-2-dropdown-multiselect": "^1.8.1",
"angular-calendar": "^0.26.4",
"angular-in-memory-web-api": "^0.7.0",
"angular-resizable-element": "^3.2.2",
"angular-tree-component": "^7.2.1",
"angular2-datetimepicker": "^1.1.1",
"angular2-google-map": "^0.1.8",
"angular2-permission": "^0.1.3",
"bootstrap": "^4.1.3",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.7",
"crypto-js": "^3.1.9-1",
"d3": "4.10.2",
"d3-array": "^2.0.2",
"d3-hierarchy": "1.1.5",
"export-to-csv": "^0.1.2",
"file-saver": "^1.3.8",
"flag-icon-css": "2.9.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"jquery": "^3.3.1",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"leaflet-map": "0.2.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"ng-click-outside": "^2.4.1",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-ckeditor": "^1.2.2",
"ng2-completer": "1.6.3",
"ng2-cookies": "^1.0.12",
"ng2-daterangepicker": "^2.0.10",
"ng2-dragula": "1.5.0",
"ng2-popover": "0.0.14",
"ng2-smart-table": "^1.3.5",
"ng2-stomp-service": "^1.2.2",
"ng2-validation": "4.2.0",
"ngc-webpack": "^4.1.2",
"ngx-bootstrap": "^2.0.5",
"ngx-carousel": "^1.3.5",
"ngx-color-picker": "^4.5.3",
"ngx-datetime-picker": "^2.0.0",
"ngx-file-drop": "^1.0.13",
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mydatepicker": "^2.4.9",
"ngx-pagination": "3.0.3",
"ngx-perfect-scrollbar": "4.9.6",
"ngx-popover": "0.0.16",
"ngx-toastr": "^9.1.1",
"ngx-treeview": "^6.0.2",
"popper.js": "^1.14.5",
"primeng": "^4.3.0",
"rxjs": "^6.3.3",
"sockjs-client": "^1.3.0",
"stompjs": "^2.3.3",
"ts-xlsx": "0.0.11",
"tslib": "^1.9.3",
"web-animations-js": "2.3.1",
"widgster": "1.0.0",
"xlsx": "^0.11.19",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.10.6",
"@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.0.4",
"@angular/language-service": "^5.2.11",
"@types/jasmine": "^2.8.12",
"@types/jasminewd2": "^2.0.6",
"@types/jquery": "^3.3.22",
"@types/lodash": "^4.14.118",
"@types/node": "^6.14.2",
"codelyzer": "^4.5.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "^3.1.6"
}
}


> My Approutes.ts file



import { AuthGuard } from './guards/auth.guard';
import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import { LoginComponent } from './pages/login/login/login.component';
import { AuthenticatedComponent } from './authenticated/authenticated.component';
import { MainComponent } from './common/main/main.component';
import { UserTrackingComponent } from './pages/user-tracking/user-tracking.component';
import { MapComponent } from './pages/customerconfiguration/map/map.component';
import { IPermissionGuardModel, PermissionGuard } from '../../node_modules/angular2-permission';
import { UsermasterComponent } from './pages/customerconfiguration/usermaster/usermaster.component';
import { DeviceInventorySidebarComponent } from './pages/inventory/device-inventory-sidebar/device-inventory-sidebar.component';
import { GroupComponent } from './pages/group-definition/group/group.component';
import { GroupDefinitionComponent } from './pages/group-definition/group-definition/group-definition.component';
import { DeviceProfileComponent } from './pages/device-profile/device-profile/device-profile.component';
import { AlertManagementSidebarComponent } from './pages/alert/alert-management-sidebar/alert-management-sidebar.component';
export const AppRoutes: Routes = [
{
path: "",
canActivate: [AuthGuard],
component: AuthenticatedComponent,
children: [
{
path: "",
component: MainComponent,
loadChildren: "./pages/dashboard.module#DashboardModule",
},

{
path: 'profileconfiguration',
pathMatch: "full",
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile-configuration/device-profile-configuration.module#DeviceProfileConfigurationModule'

},



{
path: 'profile',
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile/device-profile.module#DeviceProfileModule'
},


]

},
{
path: "login",
component: LoginComponent
},
{
redirectTo: "",
path: "**",
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(AppRoutes, {
preloadingStrategy: PreloadAllModules,
});



DeviceProfileConfiguration file




import { AuthGuard } from "../../guards/auth.guard";
import { PermissionGuard, IPermissionGuardModel } from "../../../../node_modules/angular2-permission";
import { LoraComponent } from "./lora/lora.component";
import { HrComponent } from "./hr/hr.component";
import { SkinTempComponent } from "./skin-temp/skin-temp.component";
import { FallComponent } from "./fall/fall.component";
import { BatteryComponent } from "./battery/battery.component";
import { NgModule, ModuleWithProviders } from "../../../../node_modules/@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from "@angular/router";
import { DeviceProfileConfigurationComponent } from "./device-profile-configuration/device-profile-configuration.component";
import { Common_Module } from "../../common/common-module";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule, MatDialogModule, MatSidenavModule, MatStepperModule, MatSelectModule, MatTooltipModule, MatSlideToggleModule } from "@angular/material";

export const routes = [
{
path: "",
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileConfigurationComponent,
redirectTo: "lora/add",pathMatch: 'full'
},
{
path: "hr",
redirectTo: "hr/add",
pathMatch: 'full'
}, {
path: 'hr/:action',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'hr/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "st",
redirectTo: "st/add",
pathMatch: 'full'
}, {
path: 'st/:action',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'st/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "fall",
redirectTo: "fall/add",
pathMatch: 'full'
}, {
path: 'fall/:action',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'fall/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "battery",
redirectTo: "battery/add",
pathMatch: 'full'
}, {
path: 'battery/:action',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'battery/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}
];

export const DeviceProfileConfigRouter:ModuleWithProviders = RouterModule.forChild(routes);

@NgModule({
imports:[
CommonModule,
Common_Module,
ReactiveFormsModule,
FormsModule,
BrowserModule,
BrowserAnimationsModule,
MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule,
MatDialogModule, MatSidenavModule, MatSelectModule, MatDialogModule, MatStepperModule, MatTooltipModule, MatSlideToggleModule,
RouterModule.forChild(routes)
],
declarations:[
LoraComponent,
HrComponent,
BatteryComponent,
FallComponent,
FallComponent,
SkinTempComponent,

]
})

export class DeviceProfileConfigurationModule{}









share|improve this question
























  • plz provide your tx code
    – federico scamuzzi
    Nov 19 at 12:04










  • hello @federicoscamuzzi please check the updated question
    – moreshwar
    Nov 19 at 12:27













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





Cmd Output of ng serve




Date: 2018-11-19T11:53:47.208Z

Hash: 8b2719588798f3cae7c5

Time: 17051ms

chunk {main} main.js, main.js.map (main) 1.84 kB [initial] [rendered]

chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.3 kB [initial] [rendered]

chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]

chunk {scripts} scripts.js, scripts.js.map (scripts) 1.08 MB [rendered]

chunk {styles} styles.js, styles.js.map (styles) 1.73 MB [initial] [rendered]

chunk {vendor} vendor.js, vendor.js.map (vendor) 318 kB [initial] [rendered]



ERROR in No NgModule metadata found for 'DeviceProfileConfigurationModule'.  
i 「wdm」: Failed to compile.



Getting above error after updating angular app from angular 4 to angular 7 or 6 i tried below steps but not working. Any other solution please ?



npm cache clean --force

npm install

npm install --save-dev @angular/cli@latest


please check files



> Package.json file



{
"name": "asset-web",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^7.0.4",
"@angular/cdk": "^7.0.4",
"@angular/common": "^7.0.4",
"@angular/compiler": "^7.0.4",
"@angular/core": "^7.0.4",
"@angular/forms": "^7.0.4",
"@angular/http": "^7.0.4",
"@angular/material": "^7.0.4",
"@angular/platform-browser": "^7.0.4",
"@angular/platform-browser-dynamic": "^7.0.4",
"@angular/router": "^7.0.4",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
"@swimlane/ngx-charts": "^10.0.0",
"@swimlane/ngx-datatable": "10.2.3",
"@types/file-saver": "0.0.1",
"@types/googlemaps": "^3.30.16",
"@types/xlsx": "0.0.36",
"agm-core": "^1.0.0-beta.5",
"angular-2-dropdown-multiselect": "^1.8.1",
"angular-calendar": "^0.26.4",
"angular-in-memory-web-api": "^0.7.0",
"angular-resizable-element": "^3.2.2",
"angular-tree-component": "^7.2.1",
"angular2-datetimepicker": "^1.1.1",
"angular2-google-map": "^0.1.8",
"angular2-permission": "^0.1.3",
"bootstrap": "^4.1.3",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.7",
"crypto-js": "^3.1.9-1",
"d3": "4.10.2",
"d3-array": "^2.0.2",
"d3-hierarchy": "1.1.5",
"export-to-csv": "^0.1.2",
"file-saver": "^1.3.8",
"flag-icon-css": "2.9.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"jquery": "^3.3.1",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"leaflet-map": "0.2.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"ng-click-outside": "^2.4.1",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-ckeditor": "^1.2.2",
"ng2-completer": "1.6.3",
"ng2-cookies": "^1.0.12",
"ng2-daterangepicker": "^2.0.10",
"ng2-dragula": "1.5.0",
"ng2-popover": "0.0.14",
"ng2-smart-table": "^1.3.5",
"ng2-stomp-service": "^1.2.2",
"ng2-validation": "4.2.0",
"ngc-webpack": "^4.1.2",
"ngx-bootstrap": "^2.0.5",
"ngx-carousel": "^1.3.5",
"ngx-color-picker": "^4.5.3",
"ngx-datetime-picker": "^2.0.0",
"ngx-file-drop": "^1.0.13",
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mydatepicker": "^2.4.9",
"ngx-pagination": "3.0.3",
"ngx-perfect-scrollbar": "4.9.6",
"ngx-popover": "0.0.16",
"ngx-toastr": "^9.1.1",
"ngx-treeview": "^6.0.2",
"popper.js": "^1.14.5",
"primeng": "^4.3.0",
"rxjs": "^6.3.3",
"sockjs-client": "^1.3.0",
"stompjs": "^2.3.3",
"ts-xlsx": "0.0.11",
"tslib": "^1.9.3",
"web-animations-js": "2.3.1",
"widgster": "1.0.0",
"xlsx": "^0.11.19",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.10.6",
"@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.0.4",
"@angular/language-service": "^5.2.11",
"@types/jasmine": "^2.8.12",
"@types/jasminewd2": "^2.0.6",
"@types/jquery": "^3.3.22",
"@types/lodash": "^4.14.118",
"@types/node": "^6.14.2",
"codelyzer": "^4.5.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "^3.1.6"
}
}


> My Approutes.ts file



import { AuthGuard } from './guards/auth.guard';
import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import { LoginComponent } from './pages/login/login/login.component';
import { AuthenticatedComponent } from './authenticated/authenticated.component';
import { MainComponent } from './common/main/main.component';
import { UserTrackingComponent } from './pages/user-tracking/user-tracking.component';
import { MapComponent } from './pages/customerconfiguration/map/map.component';
import { IPermissionGuardModel, PermissionGuard } from '../../node_modules/angular2-permission';
import { UsermasterComponent } from './pages/customerconfiguration/usermaster/usermaster.component';
import { DeviceInventorySidebarComponent } from './pages/inventory/device-inventory-sidebar/device-inventory-sidebar.component';
import { GroupComponent } from './pages/group-definition/group/group.component';
import { GroupDefinitionComponent } from './pages/group-definition/group-definition/group-definition.component';
import { DeviceProfileComponent } from './pages/device-profile/device-profile/device-profile.component';
import { AlertManagementSidebarComponent } from './pages/alert/alert-management-sidebar/alert-management-sidebar.component';
export const AppRoutes: Routes = [
{
path: "",
canActivate: [AuthGuard],
component: AuthenticatedComponent,
children: [
{
path: "",
component: MainComponent,
loadChildren: "./pages/dashboard.module#DashboardModule",
},

{
path: 'profileconfiguration',
pathMatch: "full",
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile-configuration/device-profile-configuration.module#DeviceProfileConfigurationModule'

},



{
path: 'profile',
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile/device-profile.module#DeviceProfileModule'
},


]

},
{
path: "login",
component: LoginComponent
},
{
redirectTo: "",
path: "**",
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(AppRoutes, {
preloadingStrategy: PreloadAllModules,
});



DeviceProfileConfiguration file




import { AuthGuard } from "../../guards/auth.guard";
import { PermissionGuard, IPermissionGuardModel } from "../../../../node_modules/angular2-permission";
import { LoraComponent } from "./lora/lora.component";
import { HrComponent } from "./hr/hr.component";
import { SkinTempComponent } from "./skin-temp/skin-temp.component";
import { FallComponent } from "./fall/fall.component";
import { BatteryComponent } from "./battery/battery.component";
import { NgModule, ModuleWithProviders } from "../../../../node_modules/@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from "@angular/router";
import { DeviceProfileConfigurationComponent } from "./device-profile-configuration/device-profile-configuration.component";
import { Common_Module } from "../../common/common-module";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule, MatDialogModule, MatSidenavModule, MatStepperModule, MatSelectModule, MatTooltipModule, MatSlideToggleModule } from "@angular/material";

export const routes = [
{
path: "",
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileConfigurationComponent,
redirectTo: "lora/add",pathMatch: 'full'
},
{
path: "hr",
redirectTo: "hr/add",
pathMatch: 'full'
}, {
path: 'hr/:action',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'hr/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "st",
redirectTo: "st/add",
pathMatch: 'full'
}, {
path: 'st/:action',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'st/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "fall",
redirectTo: "fall/add",
pathMatch: 'full'
}, {
path: 'fall/:action',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'fall/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "battery",
redirectTo: "battery/add",
pathMatch: 'full'
}, {
path: 'battery/:action',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'battery/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}
];

export const DeviceProfileConfigRouter:ModuleWithProviders = RouterModule.forChild(routes);

@NgModule({
imports:[
CommonModule,
Common_Module,
ReactiveFormsModule,
FormsModule,
BrowserModule,
BrowserAnimationsModule,
MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule,
MatDialogModule, MatSidenavModule, MatSelectModule, MatDialogModule, MatStepperModule, MatTooltipModule, MatSlideToggleModule,
RouterModule.forChild(routes)
],
declarations:[
LoraComponent,
HrComponent,
BatteryComponent,
FallComponent,
FallComponent,
SkinTempComponent,

]
})

export class DeviceProfileConfigurationModule{}









share|improve this question















Cmd Output of ng serve




Date: 2018-11-19T11:53:47.208Z

Hash: 8b2719588798f3cae7c5

Time: 17051ms

chunk {main} main.js, main.js.map (main) 1.84 kB [initial] [rendered]

chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.3 kB [initial] [rendered]

chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]

chunk {scripts} scripts.js, scripts.js.map (scripts) 1.08 MB [rendered]

chunk {styles} styles.js, styles.js.map (styles) 1.73 MB [initial] [rendered]

chunk {vendor} vendor.js, vendor.js.map (vendor) 318 kB [initial] [rendered]



ERROR in No NgModule metadata found for 'DeviceProfileConfigurationModule'.  
i 「wdm」: Failed to compile.



Getting above error after updating angular app from angular 4 to angular 7 or 6 i tried below steps but not working. Any other solution please ?



npm cache clean --force

npm install

npm install --save-dev @angular/cli@latest


please check files



> Package.json file



{
"name": "asset-web",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "^7.0.4",
"@angular/cdk": "^7.0.4",
"@angular/common": "^7.0.4",
"@angular/compiler": "^7.0.4",
"@angular/core": "^7.0.4",
"@angular/forms": "^7.0.4",
"@angular/http": "^7.0.4",
"@angular/material": "^7.0.4",
"@angular/platform-browser": "^7.0.4",
"@angular/platform-browser-dynamic": "^7.0.4",
"@angular/router": "^7.0.4",
"@ng-bootstrap/ng-bootstrap": "^4.0.0",
"@swimlane/ngx-charts": "^10.0.0",
"@swimlane/ngx-datatable": "10.2.3",
"@types/file-saver": "0.0.1",
"@types/googlemaps": "^3.30.16",
"@types/xlsx": "0.0.36",
"agm-core": "^1.0.0-beta.5",
"angular-2-dropdown-multiselect": "^1.8.1",
"angular-calendar": "^0.26.4",
"angular-in-memory-web-api": "^0.7.0",
"angular-resizable-element": "^3.2.2",
"angular-tree-component": "^7.2.1",
"angular2-datetimepicker": "^1.1.1",
"angular2-google-map": "^0.1.8",
"angular2-permission": "^0.1.3",
"bootstrap": "^4.1.3",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.7",
"crypto-js": "^3.1.9-1",
"d3": "4.10.2",
"d3-array": "^2.0.2",
"d3-hierarchy": "1.1.5",
"export-to-csv": "^0.1.2",
"file-saver": "^1.3.8",
"flag-icon-css": "2.9.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"jquery": "^3.3.1",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"leaflet-map": "0.2.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"ng-click-outside": "^2.4.1",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-ckeditor": "^1.2.2",
"ng2-completer": "1.6.3",
"ng2-cookies": "^1.0.12",
"ng2-daterangepicker": "^2.0.10",
"ng2-dragula": "1.5.0",
"ng2-popover": "0.0.14",
"ng2-smart-table": "^1.3.5",
"ng2-stomp-service": "^1.2.2",
"ng2-validation": "4.2.0",
"ngc-webpack": "^4.1.2",
"ngx-bootstrap": "^2.0.5",
"ngx-carousel": "^1.3.5",
"ngx-color-picker": "^4.5.3",
"ngx-datetime-picker": "^2.0.0",
"ngx-file-drop": "^1.0.13",
"ngx-mat-daterange-picker": "^1.1.4",
"ngx-mydatepicker": "^2.4.9",
"ngx-pagination": "3.0.3",
"ngx-perfect-scrollbar": "4.9.6",
"ngx-popover": "0.0.16",
"ngx-toastr": "^9.1.1",
"ngx-treeview": "^6.0.2",
"popper.js": "^1.14.5",
"primeng": "^4.3.0",
"rxjs": "^6.3.3",
"sockjs-client": "^1.3.0",
"stompjs": "^2.3.3",
"ts-xlsx": "0.0.11",
"tslib": "^1.9.3",
"web-animations-js": "2.3.1",
"widgster": "1.0.0",
"xlsx": "^0.11.19",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.10.6",
"@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.0.4",
"@angular/language-service": "^5.2.11",
"@types/jasmine": "^2.8.12",
"@types/jasminewd2": "^2.0.6",
"@types/jquery": "^3.3.22",
"@types/lodash": "^4.14.118",
"@types/node": "^6.14.2",
"codelyzer": "^4.5.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "^3.1.6"
}
}


> My Approutes.ts file



import { AuthGuard } from './guards/auth.guard';
import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import { LoginComponent } from './pages/login/login/login.component';
import { AuthenticatedComponent } from './authenticated/authenticated.component';
import { MainComponent } from './common/main/main.component';
import { UserTrackingComponent } from './pages/user-tracking/user-tracking.component';
import { MapComponent } from './pages/customerconfiguration/map/map.component';
import { IPermissionGuardModel, PermissionGuard } from '../../node_modules/angular2-permission';
import { UsermasterComponent } from './pages/customerconfiguration/usermaster/usermaster.component';
import { DeviceInventorySidebarComponent } from './pages/inventory/device-inventory-sidebar/device-inventory-sidebar.component';
import { GroupComponent } from './pages/group-definition/group/group.component';
import { GroupDefinitionComponent } from './pages/group-definition/group-definition/group-definition.component';
import { DeviceProfileComponent } from './pages/device-profile/device-profile/device-profile.component';
import { AlertManagementSidebarComponent } from './pages/alert/alert-management-sidebar/alert-management-sidebar.component';
export const AppRoutes: Routes = [
{
path: "",
canActivate: [AuthGuard],
component: AuthenticatedComponent,
children: [
{
path: "",
component: MainComponent,
loadChildren: "./pages/dashboard.module#DashboardModule",
},

{
path: 'profileconfiguration',
pathMatch: "full",
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile-configuration/device-profile-configuration.module#DeviceProfileConfigurationModule'

},



{
path: 'profile',
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_DEVICE_PROFILE', 'ROLE_UPDATE_DEVICE_PROFILE', 'ROLE_VIEW_DEVICE_PROFILE'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
loadChildren: './pages/device-profile/device-profile.module#DeviceProfileModule'
},


]

},
{
path: "login",
component: LoginComponent
},
{
redirectTo: "",
path: "**",
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(AppRoutes, {
preloadingStrategy: PreloadAllModules,
});



DeviceProfileConfiguration file




import { AuthGuard } from "../../guards/auth.guard";
import { PermissionGuard, IPermissionGuardModel } from "../../../../node_modules/angular2-permission";
import { LoraComponent } from "./lora/lora.component";
import { HrComponent } from "./hr/hr.component";
import { SkinTempComponent } from "./skin-temp/skin-temp.component";
import { FallComponent } from "./fall/fall.component";
import { BatteryComponent } from "./battery/battery.component";
import { NgModule, ModuleWithProviders } from "../../../../node_modules/@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from "@angular/router";
import { DeviceProfileConfigurationComponent } from "./device-profile-configuration/device-profile-configuration.component";
import { Common_Module } from "../../common/common-module";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule, MatDialogModule, MatSidenavModule, MatStepperModule, MatSelectModule, MatTooltipModule, MatSlideToggleModule } from "@angular/material";

export const routes = [
{
path: "",
canActivate: [AuthGuard, PermissionGuard],
component: DeviceProfileConfigurationComponent,
redirectTo: "lora/add",pathMatch: 'full'
},
{
path: "hr",
redirectTo: "hr/add",
pathMatch: 'full'
}, {
path: 'hr/:action',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'hr/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: HrComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_HEART_RATE_LEVEL_CONFIGURATION', 'ROLE_VIEW_HEART_RATE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "st",
redirectTo: "st/add",
pathMatch: 'full'
}, {
path: 'st/:action',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'st/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: SkinTempComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_UPDATE_SKIN_TEMPERATURE_LEVEL_CONFIGURATION', 'ROLE_VIEW_SKIN_TEMPERATURE_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "fall",
redirectTo: "fall/add",
pathMatch: 'full'
}, {
path: 'fall/:action',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'fall/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: FallComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_UPDATE_FALL_AND_IMMOBILITY_CONFIGURATION', 'ROLE_VIEW_FALL_AND_IMMOBILITY_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: "battery",
redirectTo: "battery/add",
pathMatch: 'full'
}, {
path: 'battery/:action',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}, {
path: 'battery/:action/:id',
canActivate: [AuthGuard, PermissionGuard],
component: BatteryComponent,
data: {
Permission: {
Only: ['ROLE_CREATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_UPDATE_BATTERY_LEVEL_CONFIGURATION', 'ROLE_VIEW_BATTERY_LEVEL_CONFIGURATION'],
RedirectTo: 'login'
} as IPermissionGuardModel
},
children:
}
];

export const DeviceProfileConfigRouter:ModuleWithProviders = RouterModule.forChild(routes);

@NgModule({
imports:[
CommonModule,
Common_Module,
ReactiveFormsModule,
FormsModule,
BrowserModule,
BrowserAnimationsModule,
MatButtonModule, MatCheckboxModule, MatRadioModule, MatAutocompleteModule, MatInputModule,
MatDialogModule, MatSidenavModule, MatSelectModule, MatDialogModule, MatStepperModule, MatTooltipModule, MatSlideToggleModule,
RouterModule.forChild(routes)
],
declarations:[
LoraComponent,
HrComponent,
BatteryComponent,
FallComponent,
FallComponent,
SkinTempComponent,

]
})

export class DeviceProfileConfigurationModule{}






angular npm angular6 angular7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 12:26

























asked Nov 19 at 12:03









moreshwar

66117




66117












  • plz provide your tx code
    – federico scamuzzi
    Nov 19 at 12:04










  • hello @federicoscamuzzi please check the updated question
    – moreshwar
    Nov 19 at 12:27


















  • plz provide your tx code
    – federico scamuzzi
    Nov 19 at 12:04










  • hello @federicoscamuzzi please check the updated question
    – moreshwar
    Nov 19 at 12:27
















plz provide your tx code
– federico scamuzzi
Nov 19 at 12:04




plz provide your tx code
– federico scamuzzi
Nov 19 at 12:04












hello @federicoscamuzzi please check the updated question
– moreshwar
Nov 19 at 12:27




hello @federicoscamuzzi please check the updated question
– moreshwar
Nov 19 at 12:27

















active

oldest

votes











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',
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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374255%2ferror-in-no-ngmodule-metadata-found-for-module-deviceprofileconfigurationmodul%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374255%2ferror-in-no-ngmodule-metadata-found-for-module-deviceprofileconfigurationmodul%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$