Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What can be used instead of ng-change?
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Other
Title:
What can be used instead of ng-change?
Miscellaneous
Thread ID:
01627133
Message ID:
01627133
Views:
37
Hi everybody,

I have the following markup
 <div class="col-md-2 col-lg-2">
            <input type="number" class="form-control" 
                   data-sm:number-format data-sm:number ng-show="!showHeightSm"
                   min="0" max="8" name="heightFt" id="heightFt"
                   ng-model="currentGuest.heightFt" ng-change="updateHeightSm(currentGuest.heightFt, currentGuest.heightIn)"/>
            <label class="col-md-1 control-label" title="Ft.">Ft.</label>
            <div class="field-validation-error">
                <span ng-show="(form.editGuestGeneralForm.heightFt.$error.min || form.editGuestGeneralForm.heightFt.$error.max) && form.editGuestGeneralForm.heightFt.$dirty">
                    @String.Format(Messages.mustBeBetweenXandY, Labels.heightInFeet, 0, 8)
                </span>
            </div>
        </div>
        <div class="col-md-2 col-lg-2">
            <input type="number" class="form-control"
                   data-sm:number-format data-sm:number ng-show="!showHeightSm"
                   min="0" max="11" name="heightIn" id="heightIn"
                   ng-model="currentGuest.heightIn" ng-change="updateHeightSm(currentGuest.heightFt, currentGuest.heightIn)"/>
            <label class="col-md-1 control-label" title="In.">In.</label>
            <div class="field-validation-error">
                <span ng-show="(form.editGuestGeneralForm.heightIn.$error.min || form.editGuestGeneralForm.heightIn.$error.max) && form.editGuestGeneralForm.heightIn.$dirty">
                    @String.Format(Messages.mustBeBetweenXandY, Labels.heightInInches, 0, 11)
                </span>
            </div>
        </div>
I have height in sm and height in inches which is calculated column in the table (e.g. HeightSm is a normal column and Height is computed column in a table). I added two extra columns heightFt and heightIn to the view model. I'm trying to re-calculate heightSm when I am entering values in Ft and In columns. The problem is that ng-change is similar to interactiveChange and fires too often, even when I press backspace when delete the value. Is there another method to use?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform