- In Visual Studio 2019, create a new ASP.NET Core 3.0 application and select the Angular template.
- Inspect the application code.
- Run the application in Debug mode.
- Create a new ASP.NET Core application using the Angular template by executing the following command:
dotnet new angular -o MyAngularApp
- Change directories (
cd MyAngularApp
) into the new application directory and runnpm install
. - View the application code by typing
code .
to launch Visual Studio Code in the current directory. - Build the application using
dotnet build
- From the commandline, set the ASP.NET Core development mode environment variable:
set ASPNETCORE_ENVIRONMENT=Development
Note: On OSX this is done using
export ASPNETCORE_ENVIRONMENT=Development
- Run the application using the
dotnet watch
tool:
dotnet watch run
- Navigate to
http://localhost:5000
to view the application.
Note: Leave the application running and the browser window open for the remainder of the lab.
- Navigate to the Counter page in running web application.
- In Visual Studio Code, Edit the counter implementation (
\ClientApp\app\components\counter\counter.ts
) to change the counter increment to 10:
export class Counter {
public currentCount = 0;
public incrementCounter() {
this.currentCount+=10;
}
}
- Edit the Counter template (
\ClientApp\components\counter\counter.html
) to change the H2 heading text. - Observe that the application has refreshed with your changes. View the console output to see the debug messages printed out during the updates.
- Create a Knockout, React, or React + Redux application using the above steps but selecting a different project template.
- Create a production build by setting
ASPNETCORE_ENVIRONMENT=Production
, then running the following:
webpack --config webpack.config.vendor.js
webpack
- Inspect the front-end resources in browser tools and verify that the resources are minified.