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

formControl and ngModel

I have the following code on angular

Student #{{i + 1}}
q.b
  • 59
  • 2
  • 3
  • 7

0
votes
1 answer

Angular2 ngModel two way binding does not work

I want to bind a model inside a ngFor loop to an input field via ngModel, but if I add another item to my list the value of the model will be visible in the model, but not in the view.
Tobias Helbich
  • 447
  • 14
  • 32
0
votes
0 answers

AngularJS: checkbox ngModel not checking

There seems to be a problem with the ngModel. I'm trying to get the selected checkbox IDs but it's not saving because their checked property isn't changed by the ngModel. These are only partial code snippets. When I turned one of the checked values…
Macaronie
  • 31
  • 3
0
votes
1 answer

how update value auto, ionic2 update value without page refresh

my ionic2 app get data from cordova plugin,but input's value had not update automatic.thank you first. my demo code: import { Component } from '@angular/core'; import { NavController, Events } from 'ionic-angular'; declare var…
王志华
  • 15
  • 3
0
votes
1 answer

Angular Modal Text Boxes Not Getting Populated with ngModel

I have a table with TV show data on it. I populate the table with dir-paginate/ng-repeat and I can click a row to open a modal to be able to edit the show but the ng-model data is not loading on the text boxes within that modal.
J.Do
  • 303
  • 6
  • 26
0
votes
1 answer

How to set value of radio button input option to null? (with Angular2 ngModel)

I am trying to create a radio button input in my Angular2 app using ngModel and value. I want three options: true, false, and null, but I can't figure out how to set one of the inputs to a value of null. Essentially if nothing has been selected (ie…
borisonr
  • 11
  • 1
  • 4
0
votes
2 answers

How can I get a template binding expression as string in Angular2?

Is there any way to get the string "myModel" in my component? import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: `` }) export class AppComponent { // how can I access…
Shackles
  • 1,264
  • 1
  • 19
  • 40
0
votes
0 answers

Extend AngularJS ngModel directive

I am trying to add $focused property to my input fields (like $touched or $valid). Here is my current code: directive('ngModel', function () { return { restrict: 'A', require: 'ngModel', link: function ($scope, $element, $attrs,…
mcfinley
  • 11
  • 4
0
votes
2 answers

angular2 ngmodel can't bind the value i wish

this is my html template code: there is my validateFloat method: validateFloat(event){ event.target.value =…
Charles
  • 123
  • 2
  • 2
  • 9
0
votes
1 answer

Angular 2 ngModel not updated after restful call

I have a simple user component that retrieve user's firstname and lastname. When user click on the submit button, it will make a restful call and retrieve the details and pass back to my user object. However, this is not happening at the moment and…
CalebC
  • 922
  • 11
  • 24
0
votes
0 answers

Can I use [(ngModel)] in a
  • or element?
  • A beginner in angular2. A documentation of ngModel in angular1 stated that it can be used with , and . Does this apply to the ngModel usage with 2 way data binding in angular2 too ? or can it be used with elements like and . What is the…
    0
    votes
    1 answer

    Angular: ng-model as a number

    I have a select which I render like this: otherDoc.sub_category is a number however, the select converts the value into string.…
    Pablo
    • 9,424
    • 17
    • 55
    • 78
    0
    votes
    1 answer

    Change on ngModel reflecting on same ngModel of other browser angular2

    I am new to angular 2 and creating a project on it. I am using npm to run angular 2 application. Currently, I am hosting application on localhost with 3000 port. Problem in my project is that when I am visiting same page simultaneously on two…
    AnkitJ
    • 346
    • 1
    • 3
    • 19
    0
    votes
    1 answer

    Angular2 ngModel checkbox undefined

    Just a quick question if anyone knows how to solve this but I have some issues with a checkbox input. It's configured in the following way
    Jacob Notte
    • 164
    • 3
    • 12
    0
    votes
    1 answer

    Angular2 ngModel-var value does not same like this.var value

    I have some strange behavior by my ngModel-values within child-component. html-code:
    Roma Kap
    • 517
    • 1
    • 8
    • 23