Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Edit to reflect John’s comments.
  • Loading branch information
rexebin committed Nov 22, 2016
commit 37d3e9f43e441ea38a917bbbd242259dc64845a2
22 changes: 11 additions & 11 deletions public/docs/ts/latest/cookbook/angular-in-dotnet-core.jade
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../_util-fns

:marked
This cookbook describes how to build an Angular app inside the MVC architecture in a .NET Core Web application. It does not explain how Angular or .NET Core works. However it will provide all the code snippets required. Therefore you will be able to follow through this cookbook even if you are currently not familiar with Angular or .NET Core.
This cookbook takes a hands-on approach to demonstrating how to build an Angular app inside the MVC architecture in a .NET Core Web application. It does not explain how Angular or .NET Core works. However it will provide all the code snippets required. Therefore you will be able to follow through this cookbook even if you are currently not familiar with Angular or .NET Core.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it may be helpful to have a short section here that identifies who the audience is

It is recommended that you follow this cookbook step by step and experience the challenges in the process.
If you want to host an Angular app inside .NET Core MVC architecture, you have come to the right place.

.NET Core supports cross platforms. You can develop .NET Core applications on Windows, macOS or Linux. This cookbook will use Visual Studio 2015 on Windows.
This cookbook will use Visual Studio 2015 on Windows. However .NET Core is a cross platform solution. You can follow this cookbook using .NET Core CLI and editor of your choice on Windows, MacOS or Linux. The principles described in this cookbook applies to all .NET Core Web Application with MVC architecture.

a#toc
:marked
Expand All @@ -22,13 +22,13 @@ a#prerequisite
:marked
## Prerequisite

If you do not have them in your system, download and install the following items:
Let's begin by downloading and installing the following requirements:

1. [Visual studio 2015 Update 3](https://go.microsoft.com/fwlink/?LinkId=691129)
1. [.NET Core Tools for Visual Studio 2015](https://go.microsoft.com/fwlink/?LinkId=691978)
1. [.Net Core SDK](https://go.microsoft.com/fwlink/?LinkID=835014)
1. [Typescript 2 for Visual Studio 2015](http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS2.0.3-TS-release20-nightly-20160921.1/TypeScript_Dev14Full.exe)
1. [Node.js Tools for Visual Studio 2015](https://aka.ms/getntvs) (optional)
1. [Visual Studio 2015 Update 3](https://download.microsoft.com/download/4/8/f/48f0645f-51b6-4733-b808-63e640cddaec/vs2015.3.exe)
1. [.NET Core Tools for Visual Studio 2015](https://download.microsoft.com/download/F/6/E/F6ECBBCC-B02F-424E-8E03-D47E9FA631B7/DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe)
1. [.Net Core SDK](https://download.microsoft.com/download/1/4/1/141760B3-805B-4583-B17C-8C5BC5A876AB/Installers/dotnet-dev-win-x64.1.0.0-preview2-1-003177.exe)
1. [TypeScript 2 for Visual Studio 2015](http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS2.0.3-TS-release20-nightly-20160921.1/TypeScript_Dev14Full.exe)
1. [Node.js Tools for Visual Studio 2015](https://visualstudiogallery.msdn.microsoft.com/68faf8ac-b953-42f5-a908-55555deccf7a/file/206630/5/NTVS%201.2%20VS%202015.msi) (optional)

a#create-dotnet-core-application
.l-main-section
Expand Down Expand Up @@ -96,11 +96,11 @@ a#create-angular-app
+makeExample('angular-in-dotnet-core/ts/_layout.html', null, 'Views/shared/_layout.cshtml')(format='.')

:marked
Now, build and run the application, you will find that .NET Core MVC application works but the Angular app does not. Open the the developer's tool in the browser, go to the console tab, you will find that the browser is complaining that it cannot find any of the scripts we inserted to `Views/Shared/_layout.cshtml` above.
Now build and run the application. The .NET Core MVC application works but the Angular app appears not to work! Let's find out why. Open the developer tools in the browser and inspect the console tab, you will find that the browser is complaining that it cannot find any of the scripts we inserted to `Views/Shared/_layout.cshtml` above.

#### 404 Errors

These 404 errors indicate that the browser could not find files in `app` and `node_modules` folders. But we have an `app` folder and a `node_modules` folder in the root directory, why the browser can not find it?
These 404 errors indicate that the browser could not find files in `app` and `node_modules` folders. We have `app` folder and `node_modules` folders in the root directory, but why can't the browser find them?

It is because .NET Core only exposes the `wwwroot` folder to browsers. All other contents in the project are private by default. It is by design so that you know exactly which part of the project is public. If the app asks for `/app` in a request, .NET Core looks for a physical `app` folder in the `wwwroot` folder.

Expand Down