Hi,
Is it possible to add an angular directive during ASP MVC helper initialization of an editor? For example:
@(Html.Infragistics().TextEditorFor(p => p.Details.Number).HtmlAttributes(new Dictionary<string, object>() { { "ng-model", "eventNumber" } }).Render())
When performing above the ng-model attribute is added to the parent div meaning the target does not get updated as expected:
<div class="ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default ui-igvalidator-target ng-pristine ng-untouched ng-valid ng-empty" id="Number"
style="width: 311px; height: 25px;" ng-model="eventNumber">
<div class="ui-igeditor-input-container ui-corner-all">
<input class="ui-igedit-input" id="NumberEditingInput" role="textbox" style="height: 100%; text-align: left;" aria-label="Text Editor" type="text">
<input type="hidden" value="Test5">
</div>
Performing this using the standard Html Helper TextBox works as expected:
@Html.TextBox("Number", "", new Dictionary<string, object>() { { "ng-model", "eventNumber" } })
<input name="BaseItemModel.UserName" class="ng-valid ng-not-empty ng-dirty ng-valid-parse ng-touched" id="BaseItemModel_UserName" type="text" value="" ng-model="eventNumber">
Thanks,
Euan.
Hello Euan,
Thank you for providing the sample application.
After investigating and doing some research for ‘AngularJS in ASP.NET MVC and Entity Framework‘ I found below links providing step by step demonstration of using AngularJS in ASP.NET MVC.In the following blog other developer provided simple but important steps to work with AngularJS and ASP.NET MVC together.
https://es.infragistics.com/community/blogs/b/dhananjay_kumar/posts/how-to-use-angularjs-in-asp-net-mvc-and-entity-framework-4
https://es.infragistics.com/community/blogs/b/dhananjay_kumar/posts/understanding-scopes-in-angularjs-custom-directives
Please refer the links and let me know if it helps to achieve your requirement.
Hi Divya,
Sample attached.
Yes, it is possible to add an angular directive during ASP MVC helper initialization of an editor.
I am working on it and trying to get more information about the error you are getting.
I would recommend you to have a look in the following help document of igTextEditor MVC helper.
http://www.igniteui.com/help/igtexteditor-jquery-api
please do provide me the sample application for the further investigation of the issue.
Looking forward to hearing you back.
Please note US office is closed from [11/24-11/27] due to thanksgiving holiday. I will review any updates on [11/28] and respond to you accordingly.
Sincerely,Divya JainAssociate Software Developer