angularjs-ng-change

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

ⅰ亾dé卋堺 提交于 2021-02-15 07:08:13
问题 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>

Responding to drop down selection change in angular without model binding

China☆狼群 提交于 2020-01-06 20:18:04
问题 I have a drop down that should cause a data fetch on change. I don't need two way binding to a model for the drop down. I just want it initially populated with a list of departments and when a user selects one, it gets the list of users in that department. The select looks like this: <select class="form-control" id="selDepartmentList" ng-model="departmentList" ng-change="getUsersInDepartment(document.getElementById("selDepartmentList").options[document.getElementById("selDepartmentList")

angularjs ng-change doesn't get fired on ng-model-onblur directive in IE9 and 10

﹥>﹥吖頭↗ 提交于 2020-01-03 02:24:09
问题 I have an input text box with a ng-model-on-blur directive(copied from Angularjs: input[text] ngChange fires while the value is changing) with a ng-change event handler attached to it. It works great as in when the user types out of the box it fires the function attached to ng-change. I modified the link function so it also binds on change and paste events. link: function(scope, elm, attr, ngModelCtrl) { if (attr.type === 'radio' || attr.type === 'checkbox') return; if($sniffer.hasEvent(

ngChange fires before value makes it out of isolate scope

元气小坏坏 提交于 2019-12-30 06:22:51
问题 //main controller angular.module('myApp') .controller('mainCtrl', function ($scope){ $scope.loadResults = function (){ console.log($scope.searchFilter); }; }); // directive angular.module('myApp') .directive('customSearch', function () { return { scope: { searchModel: '=ngModel', searchChange: '&ngChange', }, require: 'ngModel', template: '<input type="text" ng-model="searchModel" ng-change="searchChange()"/>', restrict: 'E' }; }); // html <custom-search ng-model="searchFilter" ng-change=

AngularJS - Why is ng-change called before the model is updated?

折月煮酒 提交于 2019-12-30 05:59:47
问题 Please see the following plnkr: http://plnkr.co/edit/KZwIBX?p=preview The first standard select works as expected(at least as far as I expected/anticipated), meaning that ng-change is called after the model is updated. But when I create a directive that has an isolate scope it would seem that ng-change is called before my model is updated. Obviously there is something I am misunderstanding. Situation very similar to AngularJS scope updated after ng-change 回答1: The problem with the example in

Weird behavior ionic in select, ng-model won't update

谁说我不能喝 提交于 2019-12-23 16:33:40
问题 I'm experiencing something weird, this example works in codepen but won't work in my Ionic app. When I change the option in the select tag I want to show the selected value, but it won't work, it shows undefined , i've tried in many ways. This is not the original code, the original one retrieves the values from an external API and populates the options with ngOptions (which works, it populates ok). But it won't update the value in the controller. So I decided to make it more simple, and it

Angular ng-change not calling code. Am I using wrong model

丶灬走出姿态 提交于 2019-12-23 01:12:36
问题 I am building an app using MEAN.js generators and a tutorial I found online. Here I have a datepicker in one of my Angular views. For now I would like the ng-change directive to be recognized and do something. At the moment when I make a change to the date my test alert shown here does not get called. <div class="form-group"> <label class="control-label" for="statusdate">Status Date</label> <div class="controls"> <input type="date" ng-change="alert('something')" data-ng-model="statusDate" id=

Angular ng-change not calling code. Am I using wrong model

杀马特。学长 韩版系。学妹 提交于 2019-12-23 01:12:08
问题 I am building an app using MEAN.js generators and a tutorial I found online. Here I have a datepicker in one of my Angular views. For now I would like the ng-change directive to be recognized and do something. At the moment when I make a change to the date my test alert shown here does not get called. <div class="form-group"> <label class="control-label" for="statusdate">Status Date</label> <div class="controls"> <input type="date" ng-change="alert('something')" data-ng-model="statusDate" id=

How to add ng-model functionality to a component

两盒软妹~` 提交于 2019-12-17 16:54:38
问题 Angular ng-change on ng-model passed into child directive Basically, I want to be able to pass in ng-model from a parent directive to a child directive. I could just in a 2-way binded value, but then I wouldn't be able to use a ng-change in the parent directive on the child element. I could also use ng-click, but this wouldn't work with a non-clicking change (such as a text area instead of a checkbox). So I'm wondering if there's a way to allow a custom directives to have a ng-model/ng-change