Every time I execute the command npm start
, my Angular application works perfectly as intended.
However, when I attempt to build it in "prod" mode, my application doesn't seem to function properly. It only displays a static page.
All navigation links have stopped working.
package.json
{
"name": "srm-roster",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "service ng serve --proxy-config proxyconfig.json --port 5555",
"build": "service ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/cdk": "~7.0.3",
"@angular/common": "~7.0.0",
-- and so forth --
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "~7.0.3",
"@angular/compiler-cli": "~7.0.0",
"@angular/language-service": "~7.0.0",
"@types/node": "~8.9.4",
-- and so forth --
}
}
This is how my app-routing.module.ts appears:
const routes: Routes = [
{
path: 'dashboard',
component: DashboardComponent
}, {
path: 'rostertable',
component: RostertableComponent
}, {
path: '**',
redirectTo : 'dashboard'
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }