Reputation: 39
I have been going through many Angular 2/4 tutorials in hopes to gather enough confidence to commit to building a project. Most of them use Angular cli to generate a starter template.
Just a few days ago I stumbled on a lecture explaining .NET Core Angular templates using dotnet cli. Since most of my deployment lives in Azure, I welcomed the idea of using the templates prepared by Microsoft.
Both starter sites work, but the files generated are very different. I understand that the actual Angular app will live in ClientApp (dotnet) or src (ng) folders and can be moved from one environment to another, but I would like to adhere to a solution that will be publish/production ready.
My questions are: are there any advantages using one cli over another? Are there any advanced features that dotnet has and ng doesn't? Will dotnet generated site perform better than ng site when deployed on Azure?
PS. I managed to update dotnet templates to Angular 4. I needed to do that so I could wire up purchased admin templates to the starter site (they use v4). However, not all the styles/behavior resolve as they should. Different story with Angular cli - integrating the ready admin templates is easier. Could that be a decisive factor?
Thanks in advance.
Upvotes: 2
Views: 1281
Reputation: 509
A bit of time has passed since your question was asked, but as an FYI to people visiting this question that Microsoft recently updated the template to be CLI-friendly.
Instructions on how to add the template are here: https://github.com/aspnet/JavaScriptServices/issues/1288#issuecomment-346003334
As of writing, the most recent version of the Microsoft.DotNet.Web.Spa.ProjectTemplates package is 2.0.0-rc1-final.
Upvotes: 1
Reputation: 331
Using Visual Studio and the Angular templates to create an Angular app is hard. I tried it, plugged away at it for days, and ended up moving to Angular CLI.
The "hello world" stuff works OK through Visual Studio but when you try to get a bit more sophisticated it soon starts falling down. Trying to debug errors etc is hard, 3rd party modules dont work properly...
I would highly recommend using Angular CLI, command prompt, VS Code and Chrome debugger to develop your front-end. Keep Visual Studio for what its good at these days: building your .Net Core back-end. You will also find the Angular community can help you a lot more readily if they don't have to elimintate Visual Studio from every problem.
For what its worth the resulting websites produced by both options you are considering would perform roughly the same. After all its pretty much the same source code and the same compilers you are comparing.
Upvotes: 5