bluePearl
bluePearl

Reputation: 1257

display angular2 app within asp.net mvc application

Referenced Tutorial I am following this tutorial but i wanted to display my angular2 app based on a tab click from the menu rather than have it default load the angular app. so in my mvc i have a menu bar : Home, About, Contact tabs and i would like to load my angular2 app once i click the About tab... How can i configure that?

How can i configure a link in asp.net mvc to route to the angular app? Would i have to change the app/main.ts and the systemjs.config.js file?

Upvotes: 1

Views: 310

Answers (1)

yurzui
yurzui

Reputation: 214315

Step 1

Open _Layout.cshtml and cut angular scripts as follows:

enter image description here

Step 2

Then remove

<my-app>Loading...</my-app>

tag from Index.cshtml

enter image description here

Step 3

and add it to About.cshtml. Also add angular scripts that we have already copied from step1 to scripts section:

enter image description here

That's all. Here is the result

enter image description here

Upvotes: 2

Related Questions