Skip to main content

Comments

Popular posts from this blog

ASP.NET Core & Angular 2 - Chapter 2 Routing

Route to a component The Angular 2 router is a powerful tool which enables you to do just that. Specifically you can configure it to route to a component when the user enters a specific url for your site. So in this case, we could configure it so that navigating to http://domain/hello routes directly to the hello world component. Open up your app.module.ts file and make the following simple change in routing section. 1 2 3 4 5 6 7 8 9 10 11 imports: [      DefaultModules, //This automatically imports BrowserModule, HttpModule, and JsonpModule too.      RouterModule.forRoot([          { path: '' , redirectTo: 'home' , pathMatch: 'full' },          { path: 'home' , component: HomeComponent },          { path: 'counter' , component: CounterComponent },       ...

ASP.NET Core & Angular 2

Introduction Now that ASP.NET Core, Angular 2, and TypeScript 2 have all shipped final versions, it’s a great time to combine them all into one powerful rich web application platform.  As well as just the basics of hosting a TypeScript-coded Angular 2 site on ASP.NET Core, the template includes: Server-side prerendering, so your UI can show up very quickly, even before the browser downloads your JavaScript code  Webpack middleware integration, so that during development, you don’t need to keep rebuilding your client-side application, or even have to run a watcher tool in the background  Hot module replacement, so that during development, whenever you edit a TypeScript file, a CSS file, or other client-side resource, your changes are pushed into the browser immediately without reloading the page (so you don’t lose your active debugging session, etc.)  Fast and lean builds. In development, you don’t have to wait for webpack to re-analyse third-party code...