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
-1
votes
2 answers

Using Angular Forms instead of ngModel

I have following Code with ngModel, which is working. HTML:
Mark Baumann
  • 98
  • 10
-1
votes
1 answer

two way binding angular Problem [(ngModel)]

I am showing my problem by giving a link to YouTube video: Admin panel is the backend and the home page is the frontend https://www.youtube.com/watch?v=6m882slecYA Full source code for Front-end code: You can find the source code for…
DeltaDev
  • 9
  • 1
-1
votes
1 answer

How to Create Date Count timer selecting date from the date picker input and show the difference of selected date to current date

** This is My Typescript file ** import { Component, OnInit } from '@angular/core'; import { interval, Subscription } from 'rxjs'; @Component({ selector: 'app-timer-app', templateUrl:…
Amir Shahzad
  • 182
  • 2
  • 10
-1
votes
1 answer

ControlValueAccessor ngModel not updated when event changed value

I have a component that use controlvalueaccessor to bind ngModel passed form parent component password.component.ts: import { Component, ElementRef, forwardRef, HostListener, Input, OnChanges, OnInit, SimpleChanges } from…
Aref Zamani
  • 2,023
  • 2
  • 20
  • 40
-1
votes
1 answer

binding [(ngModel)] to undefined value

I have the below [(ngModel)] resulting in an error since I am not getting any values from the backend, in the above example I am not getting any values for test array from the backend…
Jay
  • 2,485
  • 6
  • 28
  • 34
-1
votes
1 answer

Angular mat-button-toggle rendering does not bind to ngModel

I have been trying to fix a bug where the mat-button-toggle element renders as "selected", even though the ngModel has a false value. And I found something, that at least to me looks strange. Consider a code example: .html
Arsen Simonean
  • 362
  • 2
  • 17
-1
votes
1 answer

How to use ngModel two-way binding to bind some properties of one object to another object?

Is is possible to bind some properties of one object to another object using two way binding in Angular? One example is like: JS object_1 { property1:string, property2:string, property3:string, property4:string } object_2 { …
YHZ
  • 33
  • 6
-1
votes
1 answer

Template variable is undefined when using ngFor

When assigning ngModel to a template variable within an ngFor the value is undefined. It's been brought up on the Angular repo here but it's been over a year with seemingly no resolution. Does anybody have a solution or workaround? Seems like it…
Amerikaner
  • 131
  • 1
  • 1
  • 7
-1
votes
1 answer

How to have control over an input field from a template of a directive in AngularJs

My directive contains in its template a simple input field, and I'm lookin for a solution to have control on that input field by using ngModel, but I don't know how to do. Template: Directive…
Donovant
  • 3,091
  • 8
  • 40
  • 68
-1
votes
1 answer

Is it possible to hack Angular 2 disabled input tag?

For example I have this part of code in my component's template: And in my component's module I have: if (this.currentUser.role == "Admin") { …
-2
votes
2 answers
-2
votes
1 answer

Erreur: Can't bind to 'ngModel' since it isn't a known property of 'input'. Besoin d'aide

Here I still have this error, I did what I found on the doc and on the forums but I have to miss something. Can someone help…
joss
  • 9
  • 2
-2
votes
1 answer

I am making a chat forum and I am having probels with ng Model

I am getting and error why trying to use [(ngModel)]="message" to build a form, the error I am getting is, Identifier 'message' is not defined. The component declaration, template variable declarations, and element references do not contain such a…
-2
votes
1 answer

Angular how to use ngModel correctly? Why I get undefined and errors?

I'm having some issues with this code, Angular logs "undefined" when I use the input field, its a basic component, but can't make it work. HTML template:

{{ titulo }}

  • hlelo
  • hlelo
  • hlelo
  • hlelo
Yala Yala Herzlin
  • 552
  • 2
  • 8
  • 25
-2
votes
2 answers

Pass an html ngModel value to service

I want to pass an html ngModel value which is located on app.component.html, to a service which is called email.service.ts. Inside the service I have this code: const apiEmail…
1 2 3
25
26