-1

I am trying to connect asp.net mvc 4 app with angular 11. Asp.Net Has controllers which handles server side posts to communicate with backend services. So the front end including styles are take care by angular 11 app. Initially i had tried with Asp.net core with angular 11 it worked like a charm, however due to some architectural decisions its been decided to proceed with asp.net mvc C# with angular 11. I was able to do most of the stuff but facing an error now. Please advise how to fix this issue

"The selector "app-root" did not match any elements"

enter image description here

Code behind of the page loaded enter image description here

Project Details Web Project framework -> .Net 4.6.2 System.Web.Mvc - > Version 5.2.7.0, Runtime version - v4.0.30319

Angular 11 app is placed inside {Asp.netproject folder}/bundles/AngularOutput -Screenshot as below enter image description here

For time being hard coding all the file names required for loading angular project, which was build in release mode (ng build --prod) enter image description here

Index Page in asp.net mvc _Layout.cshtml :

ControllerName/Index - View -> Index.cshtml (View of the page being loaded) I have added all 3 to check if any one works enter image description here

In angular app -> app.component.html (app-container)-> modified as per article enter image description here

Container.component.html (app-container)

enter image description here

Dilip
  • 474
  • 2
  • 8
  • 18

1 Answers1

0

Enabled angular routing to make things work

Dilip
  • 474
  • 2
  • 8
  • 18