0

I want to have 2 separate Angularjs App in one Asp.net MVC project. How can i Handle initiate html page for these two Angularjs app with?
I want my spa website initiate at this url (cshtml view)

Home/Index

And another spa app for admin panel initiate in this url (cshtml view)

Admin/Index

My question is how can AngularJs app recognise its own parent initiated .cshtml file?

1
  • I'm curious why this question was downvoted. I arrived here looking for the same exact thing, so Hossein isn't the only one looking to do something like this. Arief's answer below points to the direction we're looking to take (MVC routing for the project level and Angular 2 routing once inside the 'silos' of the application). Does anyone have anything to add insofar as file structure to logically separate each of the Angular applications? Commented Oct 6, 2016 at 12:43

1 Answer 1

2

Angularjs doesn't allow to create more than one angular app in a single page. Having said that you can technically have two angular apps on two different pages, if you decide not to use angular routing and use MVC routing then all u have to do is use ng-app in both the html index files (of course with different names and ) load the corresponding js files as needed.

If you want go a step further and use MVC routing at project level and angular routing at index level, things will be easier to maintain.

Sign up to request clarification or add additional context in comments.

1 Comment

Arief, do you have any suggestions on folder structures we could use to achieve the separation of Angular applications without losing our minds trying to figure out which components go with which application?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.