This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web; | |
using System.Web.Mvc; | |
using Sitecore.Mvc.Extensions; | |
namespace sitecore.local.Controllers | |
{ | |
public static class Angular | |
{ | |
public static IHtmlString RawJsEncodedString<T>(this HtmlHelper<T> htmlHelper, HtmlString str) | |
{ | |
var test = str.ToString(); | |
if (test.IsEmptyOrNull()) | |
{ | |
return new HtmlString(string.Empty); | |
} | |
return new HtmlString(HttpUtility.JavaScriptStringEncode(test)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment