Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Is it possible to add an angular directive during ASP MVC helper initialization of an editor
posted

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>
</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.