Angular CLI in ASP.NET Core 2 Angular template?

后端 未结 3 1102
广开言路
广开言路 2020-12-03 04:22

I know the basics of Angular and ASP.NET Core 2, but not on the level that would allow me to understand how this template works.

I tried generating components using

3条回答
  •  青春惊慌失措
    2020-12-03 04:44

    The visual studio supports Angular CLI with Asp.Net Core project in the newest version of Angular project template in asp.net core 2.1.

    1. If using ASP.NET Core 2.0, install the latest version of Angular project template:

      1.1. Open the visual studio

      1.2. Go to tools -> NuGet Package Manager -> Package Manager Console and run this command:

      dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates

    If you have ASP.NET Core 2.1, there's no need to install it.

    1. Create an empty folder for your project and run cmd as administrator and navigate to this folder(alternatively, press Alt + D in an empty folder and write cmd as administrator).

    2. Create a new angular project with below commands:

      dotnet new angular -o my-new-app
      cd my-new-app

    The Angular app, residing in the ClientApp subdirectory, is intended to be used for all UI concerns.

    1. Go to ClientApp folder with 'cd ClientApp' command.

    If you haven't installed the angular-cli package, run 'npm install -g @angular/cli' command.

    1. Run 'npm install' command for installing the node_modules.

    1. Run 'ng g c testComponent' command(an Angular-CLI command) for creating a testComponent.

    The test-component added to solution explorer

    Run each of Angular CLI commands:

    Good Luck

    Microsoft

    Angular CLI

提交回复
热议问题