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 Angular CLI in Visual Studio Code, however, it says I don't have the CLI. I think it's the webpack thingy that keeps the CLI and allows all the cool stuff that comes with the template, but is there a way to use the CLI despite that? Or do I have, for example, generate components manually by creating the files and adding dependecies?
I can't find any documentation on the template or a tutorial that would use it.
The updated Angular project template provides a convenient starting point for ASP.NET Core apps using Angular and the Angular CLI to implement a rich, client-side user interface (UI). The template is equivalent to creating an ASP.NET Core project to act as an API backend and an Angular CLI project to act as a UI.
To start the project, press F5 or select the Start button at the top of the window. You will see two command prompts appear: The ASP.NET Core API project running. The Angular CLI running the ng start command.
First of all after installing angular cli globally:
npm install @angular/cli@latest -g
You have to first create an angular project outside your main project with this command:
ng new hello-world
Now, go to project directory and copy .angular-cli.json
file into the root of your main dot net core project.
Then you have to edit this part of the file:
"root" : "src"
change to"root" : "ClientApp"
Next, you have to install angularCli dev in your root of your project:
cd DotNetCoreProject
npm install @angular/cli@latest --save-dev
Everythings was done!
Now, go to your component directory of your project:
cd ClientApp/app/components
and make your component in component directory in terminal:
ng g c MyComponent --module='app.module.browser.ts'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With