Angular 6 now depends on TypeScript 2.7, RxJS 6.0.0 or higher.
Changes systemjs.config.js file by adding code as follows:
packages: {
rxjs: {
main: 'index.js',
defaultExtension: 'js'
},
'rxjs/operators': {
main: 'index.js',
defaultExtension: 'js'
}
}
In App_Start/RouteConfig.cs file, change url as follows:
routes.MapRoute(
name: "Default",
url: "{*.}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
For using the Angular Router, In Views/Shared/_Layout.cshtml file, add a <base>
element as the first child in the <head>
tag.
<head>
<base href="/">
</head>