Search code examples
angularjsmaskx-editable

How to use mask in angular-xeditable?


I need to connect the mask to angular-xeditable. So I connect the mask to angularjs.

<input id="phone" name="firstName" type="text" class="form-control mb5"  placeholder="(999) 999-9999" ng-model="vm.phoneNumber" ui-jq="mask" ui-options="'(999) 999-9999'">

But I don't understand how to connect angular-xeditable

<span id="phone" editable-text="vm.phone" e-placeholder="(999) 999-9999" e-form="tableform" onbeforesave="checkName3($data)">
   {{vm.phone || '-'}}
 </span>

This option does not work.


Solution

  • try this "e-*"

    <span id="phone" editable-text="vm.phone" 
       e-placeholder="(999) 999-9999" 
       e-form="tableform" 
       e-ui-jq="mask" 
       e-ui-options="'(999) 999-9999'" 
       onbeforesave="checkName3($data)"> {{vm.phone || '-'}}
    </span>
    

    Other Option:

    include js

    /bower_components/jquery.inputmask/dist/jquery.inputmask.bundle.js   
    
    
    
    <span editable-text="ApTax" e-size="50" e-maxlength="50"
                                  e-ng-model="ApTax" e-id="ApTax"
                                  e-maskinput e-data-inputmask="'mask':'999-***'"
                                  e-name="BAS" e-form="rowform" e-required>
                                {{ ApTax}}
     </span>