This is a work-in-progress project template that combines Angular with ASP.NET Core. It's based on the same technologies used in the JavaScriptServices repo and templates, but simplified so it's more of an empty project starting point rather than an app starter kit. For simplicity, this template does not include server-side prerendering or Karma tests.
git clone
this repo.cd
to the resulting directory (i.e., the one containingStartup.cs
).- Run
npm install
oryarn
- Run
webpack --config webpack.config.vendor.js
(and first runnpm install -g webpack
if you don't already have it installed) - Run
dotnet restore
- Ensure you have an environment variable called
ASPNETCORE_ENVIRONMENT
with value set toDevelopment
. The way to do this depends on which OS/shell you are using. - Run
dotnet run
- Open a browser and navigate to
http://localhost:5000/
You should see Hello, world! in your browser, which means your application is now running. You can now edit or add Angular components, templates, modules, etc. Since Hot Module Replacement (HMR) is enabled, your changes should appear in the browser immediately.
- Complete steps 1-4 above
- Open
AngularBasicTemplate.csproj
in Visual Studio
You can now launch the application as usual via Ctrl+F5, or with debugging enabled via F5.
Run dotnet publish -c Release
from the command line, or use Visual Studio's Publish UI. This produces an ahead-of-time (AoT) compiled and minified Angular application, with the .NET code built in release mode.
- Update to the latest version of Angular 4
- Convert into a
dotnet new
template that also automates steps 3-5 for you - Convert into a regular Visual Studio project template