Info
Version: | 0.1.0 |
Author(s): | James Harris |
Last Update: | Thursday, September 18, 2014 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/jamesharris-au/aspnet-angular-template-helper |
NuGet Url: | https://www.nuget.org/packages/Angular.TemplateRender |
Install
Install-Package Angular.TemplateRender
dotnet add package Angular.TemplateRender
paket add Angular.TemplateRender
Angular.TemplateRender Download (Unzip the "nupkg" after downloading)
AngularTemplateHelper.RenderAngularTemplates(Server.MapPath("~/app"));
Usage in MVC View:
@Html.Raw(AngularTemplateHelper.RenderAngularTemplates(Server.MapPath("~/app")))
Output:
<script type=\"text/ng-template\" id=\"/app/subfolder1/test2.html\">body2htmlstring</script>
<script type=\"text/ng-template\" id=\"/app/subfolder1/test3.html\"><span>testbody3</span></script>
Note:
Need to use @Html.Raw helper if your calling it in a view, as the assembly deliberately avoids taking any dependencies on System.Web or Mvc.
You could easily wrap this as a HtmlHelper extension or similar.