Search Posts

Category: angularjs-ng-change

ng-change not getting called on checkbox

I have a select dropdown. Upon selecting each value in dropdown, checkboxes are created using ng-repeat. All the values in the dropdown are supposed to be selected and corresponding checkboxes are stored in an array when a checkbox is checked using ng-change on the checkbox. When I change back to a previous dropdown value, I am checking if the checkboxes are already there in the array used to store checked values and then check them […]

Polymer data-ng-change vs data-ng-blur

I have a paper-input item <paper-input label=”Test” data-ng-model=”item” data-ng-blur=”onBlur(x)” data-ng-change=”onChange(y)”> </paper-input> In the controller, the functions are defined as – function onBlur(x) { … } function onChange(y) { … } On losing focus on the item, onBlur is called correctly. However, on changing data in the item, the onChange function is not called. Any ideas? Source: AngularJS

Use ng-model to avoid $digest delay in Component Directives

How to call controller’s any function in directive in angularJs I’m trying to call parent controller’s function, which has not much to do with the directive, when directive’s bind value has changed. I’ve been looking through the Q&A in stack, but all of them are related to passing a value from directive to controller, which is not my case. I thought my case was generally common, the scenario is that: display complex objects in a […]

Save state of ng-change local scope in Datepicker

I have come across what seems like a very simple issue, but I cannot figure out how to fix it. I posted this question originally, but it seems the issue is with the scope. So basically, this is what is happening: I have a datepicker inside a form. When the user selects a date, ng-change will trigger and it calls the function setDate(date). In debug mode, I confirmed that the selected data indeed is passed […]

Input with Datalist – ng-change is not fired in IE for AngularJS

I have an input tag with datalist for which the ng-change is not getting fired on selection in Internet Explorer 11. It only gets fired on blur of the input. It is working in Chrome. Codepen Below: https://codepen.io/vijayvmenon/pen/gzLYgp <input list=”testList” name=”origin node” ng-model=”SelectedDoctor” ng-change=”LoadSessionData(SelectedDoctor)” autocomplete=”off” required /> <datalist id=”testList” > <option value={{value.id}} ng-repeat=”value in data”> </datalist> <p>{{selectedVal}}</p> If you check the code, you can see that in chrome the data list value is shown below […]

ng-change not working, AngularJS 1.x

AngularJS 1.59 When I edit the quantity input field the ng-change event doesn’t fire. In Chrome Dev Tools I place a breakpoint on $scope.updateToggle and it is never hit. I’ve looked at other posts on SO but cannot see what I’m doing wrong. HTML: @section scripts { <script src=”@Url.Content(“~/Binding/ViewModels/CartViewModel.js”)” type=”text/javascript”></script> } <br /> <span class=”cart-header”>Shopping Cart</span> <div data-ng-app=”appCart”> <div ng-controller=”CartViewModel”> <div class=”spinner-config” ng-show=”viewModelHelper.isLoading”> <i class=”fa fa-spinner fa-spin”></i> </div> <span style=”padding-left:600px”></span> <span class=”cart-price-header”>Price</span> <span class=”cart-quantity-header”>Quantity</span> <hr […]

Angularjs set checked radio not working

I have 3 radio buttons: <label ng-repeat=”mode in opMode.groupMode” class=”radio-inline” title=”{{mode.title}}”> <input id=”rd{{mode.id}}” type=”radio” class=”panel-load-radio” ng-model=”opdtMode.groupMode” name=”inlineRadioOptions” value=”{{mode.id}}” ng-change=”changeOpdtMode(mode.id, ‘{{opdtMode.groupMode}}’)”> {{mode.name}} </label> Here is Angularjs code: $scope.opMode = { groupMode: [ { name: “ModuleType”, title: “Load processes by Module type”, id: “ModuleType”, isDefault: false }, { name: “OpGroup”, title: “Load processes by Operation group”, id: “OpGroup”, isDefault: true }, { name: “MachineType”, title: “Load processes by Machine type”, id: “MachineType”, isDefault: false } ]}; If […]

Updating AngularJS model with ng-change causes one field to become null when updating

Updating AngularJS model values simultaneously on 3 separate fields causes one field to become null on ng-change. I’m getting some strange behavior with ng-change. What I have is 3 separate fields that all integrate together. One is for a base loan amount, one is for an estimated value of a property and the last one is the loan to value ratio. When entering a value for base loan amount and for estimated value the loan […]

Setting ng-model within ng-repeat using ng-change function

how to Setting ng-model within ng-repeat using ng-change function How do I set a result in a ng-model that is inside an ng-repeat? Example containing ng-repeat: <tbody ng-repeat=”(key,boleta) in boletas track by $index”> <tr> <td> <label for=””>NUMBER </label> <select name=’bills[{{key}}][number]’ class=”form-control” ng-change=’changeBoletas()’ ng-model=’model.numberBoleta’> <option ng-repeat=”(number, x) in model.boletas”>{{number}}</option> </select> </td> <td> <label for=””>ComisiĆ³n </label> <input name=’bills[{{key}}][runt]’ type=”number” class=”form-control comision-{{key}}” ng-model=’boleta[$index].comision’ ng-change=’dataBoleta()’> <td> <div ng-show=’true’ ng-if=”status==’applied'” data-ng-click=”removeItemBoletas($index)”> <i class=”fa fa-times color3″></i> </div> </td> </tr> </tbody> JS: […]

unable to trigger ng-change in android webview

I have given a simple text box and an change event updates a table below the text box. It works absolutely fine in the browser. But when I call this page in android webview, ng-change doesn’t trigger. Android version 4.2.2. Chrome in the android device is of version 38.0 <input type=”text” id=”barcode” name=”barcode” ng-model=”thisBarcode” ng-model-options=”{ updateOn: ‘change’ }” placeholder=”Scan Barcode Here” autofocus ng-change=”addProductToCart(this.thisBarcode)”> Source: AngularJS

Next Page »