Questions tagged [ngmodel]

Use ngmodel for questions related to the ng-model AngularJS directive.

The ngmodel directive is used for two-way data binding of form controls. It has a built-in controller named NgModelController which exposes and API which can be used for handling state changes and performing validation.

References

386 questions
0
votes
1 answer

Angular Two-Way-Databind - Change Value

I Have one Form with an input.
0
votes
1 answer

How to keep format in view but not in model? (Angular 5)

I'm making a custom component with support for the [(ngModel)] directive, and it works just fine. The problem is that I want to keep a currency format on the view and keep a "normal" number in the model, is this possible for 2-way databinding in…
user5589534
0
votes
0 answers

In Angular 5, [(ngModel)] is not working when i am trying with two way data binding with elvis operator

I use single reactive form as insert and update operation in both case radio button needed to be checked - how can I fix this issue? Here is the field I use
Kishan Sanghani
  • 279
  • 3
  • 14
0
votes
1 answer

Angular 4 - Bind boolean values from db to toggle switch on/off

In application I have a toggle switch which has to be bind to data which is in the db. The name in the db is Status and it has values True/False. Now I am looking to use toggle switch buttons in my table rows, where it should display green if status…
user8819437
  • 69
  • 1
  • 13
0
votes
1 answer

Angular 4 capture toggleswitch(on/off) value using [(ngModel)] for n number of rows

I have a toggle switch (on/off) button which i have kept in every row of my table. I want to capture the toggle on and off of every row's button so i can filter based on the results of on/off. Is it possible, if yes then how. I have the switch from…
stec1
  • 216
  • 1
  • 3
  • 12
0
votes
1 answer

Angular4 - execute function if NOT all checkboxes are selected

I have a main checkbox which has ngModel value as [(ngModel)]="formModel.acknowledged1 and on component it is set to false like formModel = { acknowledged1 :false } And I have a table with n number of rows, each row having checkboxes with…
stec1
  • 216
  • 1
  • 3
  • 12
0
votes
1 answer

Default value of select when ngModel is undefined

I have a select box tied to an ngModel: tempHours = [ {}, {}, {}, ... ]
khush
  • 2,702
  • 2
  • 16
  • 35
0
votes
1 answer

Angular 4 Select don't update on ngModel change

I am trying to make that after new value is selected, I call eventChange() function and restore selected value to default. But what happens: ngModel value updates, but selected value stays the same. How should I do that selected value and ngModel…
LoverKiss
  • 59
  • 1
  • 8
0
votes
0 answers

Angular2 ngSwitch does not replace the html when the case changes

I'm pretty new to Angular2 and I'm facing a problem with the ngSwitch directive. For some reasons that I don't understand it seems that when i change the case - changing a value in a select - the html is appended to the existing one and not…
shaqino
  • 23
  • 7
0
votes
2 answers

Angular ngModel inside ngForm with number array

I'm stuck on an issue since a while now and I can't figure out why this is happening. I have a values: number[] = [10,10] variable in my component. When I'm modifying the first input, on the keyDown, it moves my cursor to the next input sometimes,…
Mattew Eon
  • 1,722
  • 1
  • 21
  • 38
0
votes
1 answer

Angular 4 ngSubmit not getting values from jquery populated inputs

I populate form input field values programmatically with jquery. The values are visible in the form. When I console.log the form data on submit, that data doesn't contain the values. When i modify the values manually, the data does contain the…
edoras
  • 159
  • 3
  • 13
0
votes
1 answer

Problems with using ngFor and ngModel with a custom model

ngModel with ngFor and trackBy: trackByIndex isnt working as expected. This is my html template:
IdiakosE Sunday
  • 112
  • 1
  • 8
0
votes
2 answers

ngModel not working in two different components?

The title is pretty self-explanatory, so - I put an input element in app.component.html file, this is the code: Then i tried making an h1 element in another component, as…
Raptrozz
  • 3
  • 5
0
votes
1 answer

list of events for ngModel in two-way data binding

In two-way data binding using ngModel is actually
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184