c# - Angular 2 with cshtml -
i'm here know if angular2 views work cshtml files? implementing users , roles in mvc , thought render angular2 html page in cshtml page seems impossible me. doing is:
testcontroller.cs:
using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; namespace userdemo.controllers { public class testcontroller : controller { // get: test public actionresult index() { return view(); } [childactiononly] public actionresult gethtmlpage(string path) { return new filepathresult(path, "text/html"); } } }
index.html of testcontroller:
@{ viewbag.title = "index"; } <h2>test</h2> <div> @html.action("gethtmlpage", "test", new { path = "~/index.html" }) </div>
index.html angular2 view keeps in resulting errors while loading in cshtml!
Comments
Post a Comment