Questions tagged [angularjs-ng-change]

The ngChange allows to evaluate given expression when user changes the input.

Evaluate given expression when user changes the input. The expression is not evaluated when the value change is coming from the model.

Note, this directive requires ngModel to be present.

Usage

as attribute

<input
  ng-change="expression">
...
</input>

Parameters

ngChange – {expression} – Expression to evaluate upon change in input value.

References:

http://docs.angularjs.org/api/ng.directive:ngChange

265 questions
4
votes
2 answers

Fire ng-change event for textbox other than keypress or keydown

I want to update a text value when the value is changed by using some method, the method should not call when I am still typing text but when exit from the textbox or change it through script code:
satish kumar V
  • 1,695
  • 6
  • 33
  • 47
4
votes
1 answer

Angularjs: How do I get the item in a list when using ngChange?

I'm trying to get the item that just changed in this small example, is there some kind of context I should use? I hoped it would be as simple as just referring to $this, but that doesn't seem to work.
pbjork
  • 596
  • 4
  • 10
4
votes
1 answer

How do I toggle field required attribute after ng-click?

I have a dropdown list in a repeater that should toggle my custom "required" attribute. I tried ng-show but the display="none" attribute is all that was added. My options are:- 1- Add/remove the input field and set bird.Stuff, not just hide it…
MrM
  • 21,709
  • 30
  • 113
  • 139
3
votes
1 answer

Angularjs set checked radio not working

I have 3 radio buttons:
3
votes
1 answer

Angular material checkbox - add function to ng-checked

I am using the with the 'indeterminate' attribute provided by Angular Material to update an array based on the checkboxes selected. However, the Array is only updated based on ng-click, not on ng-change. Therefore, checking the "Select…
3
votes
1 answer

TR element triggers checkbox via ng-click, but ng-change on checkbox will not fire

I have successfully created functionality to check a hidden checkbox on the ng-click of the row that the checkbox exists in that is generated with an ng-repeat. However, I also have functionality that adds that item to a separate array when the…
3
votes
1 answer

AngularJS REST Api Select box ng-change

I am loading data into select boxes from external url. The problem is that ng-change is not triggered at all. However, if I create a local array it works!! I would like to update the main url based on the selection. I noticed however, that the…
3
votes
1 answer

unable to get the index of the selected item in AngularJs

I have a drop down with values which I am using a drop box to display the items. I want to handle the click event and print the index of the element in the array. The view code is as below:
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
3
votes
3 answers

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

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…
Ariel
  • 1,507
  • 2
  • 20
  • 28
3
votes
3 answers

ng-change doesn't get fired for email input unless I enter a valid email address

Model value for invalid email input is always undefined. I would like to be able to check if the user has entered any text (even if it's not yet a valid email address). Please check plnkr for more details on the implementation:…
simonaco
  • 346
  • 2
  • 4
  • 15
3
votes
4 answers

send the option object when using angularjs ng-options and ng-change

I having an array of objects which I am passing to the ng-options,the array contains objects of currencies in the next pattern: [{ "cur_iso": "ILS", "cur_symbol": "\u20aa", "cur_name_he": "\u05e9\u05e7\u05dc", …
Wazime
  • 1,423
  • 1
  • 18
  • 26
3
votes
3 answers

Using angular, How do I get selected value on ng-change on a dropdown?

So I have some data coming in a string seperated by commas. sizes: "Small,Medium,Large,X Large,XX Large" I got a drop down that displays value based on splitting that string. And in my controller I have…
Rodrigo Cifuentes Gómez
  • 1,304
  • 2
  • 13
  • 28
3
votes
1 answer

How can I force angular.js to accept trailing whitespaces in bindings?

I want to bind an input to some other part of the page and replace all whitespaces the user has entered with some other characters, like asterisks for example. My (simplified) HTML code looks like this:
3
votes
5 answers

Input cursor position jumps to end with ng-change()

I have an instance where I'm replacing the value of ngModel through ngChange. The cursor jumps to the end of the input field after each change (assuming because I'm assigning the result to the same $scope variable.) I'd like to know how I can…
EnigmaRM
  • 7,523
  • 11
  • 46
  • 72
1 2
3
17 18