Creating a new Angular project on Mac using Visual Studio

I am currently reviewing https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch/WEB-103

while setting up spa applications with Visual Studio on Mac (macOS Sierra, Visual Studio Community 2017).

I have successfully installed angular core and I am currently trying to create a new project based on one of the installed templates.

I can see two angular templates on startup sudo dotnet new -l

:

MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA ASP.NET Core with Angular angular [C#] Web/MVC/SPA

On startup, sudo dotnet new angular

I keep getting the following error:

Unable to determine the desired template from the input template name: angular.
The following templates partially match the input. Be more specific with the template name and/or language.

Templates                          Short Name      Language      Tags       
----------------------------------------------------------------------------
MVC ASP.NET Core with Angular      angular         [C#]          Web/MVC/SPA
ASP.NET Core with Angular          angular         [C#]          Web/MVC/SPA


Examples:
    dotnet new angular
    dotnet new angular
    dotnet new --help

      

Is there something about the command that I am missing? Is there something wrongly configured with Visual Studio / dotnet?

+3


source to share


1 answer


To install Single Page Templates (SPA), run the following command:

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

      

enter image description here



Now create any SPA ...

dotnet new angular -o ngApp
cd .\ngApp\
npm install
dotnet restore
dotnet run

      

+2


source







All Articles