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
Add instructions for .NET Core CLI audiences.
  • Loading branch information
rexebin committed Nov 22, 2016
commit b734514ac0d49935a947a5028cac24fe1c9bb0c0
32 changes: 32 additions & 0 deletions public/docs/ts/latest/cookbook/angular-in-dotnet-core.jade
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ a#prerequisite
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)

:marked
.l-sub-section
:marked
If you do not use Visual Studio, follow the [official instructions](https://www.microsoft.com/net/core) and install .NET Core.

a#create-dotnet-core-application
.l-main-section
:marked
Expand All @@ -44,6 +49,17 @@ a#create-dotnet-core-application
1. Select `Web Application` and click OK.
1. Wait for Visual Studio to restore packages.

:marked
.l-sub-section
:marked
You can create a .NET Core Web Application using .NET Core CLI:
1. Create a new folder
1. Open a command line window:

* `cd` into the new folder and run `dotnet new -t web`
* Run `dotnet restore` to restore packages
* Run `dotnet run` to start the web application at `localhost:5000`

a#create-angular-app
.l-main-section
:marked
Expand All @@ -63,6 +79,14 @@ a#create-angular-app
:marked
When `package.json` is created, Visual Studio will automatically install all specified npm packages. You can also right click the `package.json` file and select `Restore Packages`.

:marked
.l-sub-section
:marked
If you do not use Visual Studio, open a command line window:
1. `cd` to the root directory
1. Run `npm i` to install npm packages

:marked
### Create your Angular app

Create an `app` folder in the root directory.
Expand Down Expand Up @@ -98,6 +122,14 @@ a#create-angular-app
:marked
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.

:marked
.l-sub-section
:marked
If you do not use Visual Studio:
1. Open a command line window, `cd` into the root directory and run `npm run tsc:w` to compile and watch TypeScript files
1. Open another command line window, `cd` into the root directory and run `dotnet run` to start the web application at `localhost:5000`

:marked
#### 404 Errors

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?
Expand Down