It pains me that everywhere I looked, we get the same answers: "HTML should be just a template." Maybe, but I'm just not ready to delegate everything to JavaScript
Instead of using an anonymous object to pass HTML attributes, try using a dictionary
@Html.TextBoxFor(m => m.Name, new Dictionary<string, object>(){{ "data_ng_model", "band.Name" }})
Make sure that
Dictionary<string, object>
And not
Dictionary<string, string>
Otherwise, the constructor will confuse it for
object HtmlAttribute
Not so pretty though ... but it works for the most part.
Finally, keep in mind that if you enable AngularJS after jQuery, it will use jQuery for selectors.
source share