Questions tagged [angularjs-ng-model]

The ngModel directive in AngularJS binds an input, select, textarea (or custom form control) to a property on the scope using NgModelController, which is created and exposed by this directive.

ngModel is responsible for:

  • Instantiating the ngModelController
  • Binding the view into the model, which other directives such as input, textarea or select require.
  • Providing validation behavior (i.e. required, number, email, url).
  • Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
  • Setting related CSS classes on the element (ng-valid, ng-invalid, ng-dirty, ng-pristine, ng-touched, ng-untouched) including animations.
  • Registering the control with its parent form.
  • Formatters, Parsers and View change listeners

Information from AngularJS API

See also

532 questions
0
votes
1 answer

Update Scope by selecting checkboxes

I have two tables that I want to filter by either using an individual select dropdown in the table row or by selecting multiple checkboxes and bulk updating the scope. A user should be able to check the records, select the top dropdown status, and…
User970008
  • 1,135
  • 3
  • 20
  • 49
0
votes
1 answer

AngularJS $scope not updating when using ng-model (ng-change fires?)

I'm new to Angular (and javascript), so there's probably a pretty simple reason that this isn't working. I've got a datepicker that gives me a date based on which I generate some content to display. So if the date from the datepicker changes, I…
0
votes
1 answer

unsual behavior when binding checkbox output to an object's property using ng-model

I am unable to understand the following behaviour: Here is my angular code: (function(){ 'use strict'; angular.module('myMod',[ ]) .controller('abc',function($scope) { $scope.products = products; $scope.printProducts =…
0
votes
1 answer

Angularjs - ng-model with array with dynamic size

This is my scenario, view:
controller: $scope.projects=…
0
votes
1 answer

Getting values from an object into ng-model

I have resource that gets an object: .factory('Product', ['$resource', function($resource) { return $resource( 'api/product/:id', { Id: '@Id' }, { update: { method: 'PUT', isArray: false } }); }]) I call this resource from…
medarz
  • 11
  • 2
0
votes
1 answer

update of ngModel inside Angular directive

I am binding an object from my controller on a directive in that controller. I can update fields from the directive on ngModel, however I cant seem to add or delete items from an existing property of type Array on that ngModel. It doesnt reflect on…
0
votes
1 answer

AngularJS - select with track by doesn't set list object in ng-model

I've got a select: Data_source objects in my data_sources array are of the form {id:"myid",…
0
votes
1 answer

Function assigning to ng-model in Angular

I want to integrate a slider into my website. I use http://darul75.github.io/ng-slider/ for that. However I do not want to use hardcoded starting points and end points for my slider. Neither do I want a hard coded default value such as …
Dribel
  • 465
  • 1
  • 10
  • 24
0
votes
1 answer

Parsing object in ng-options for angularjs select drop down using nested json

I have the following json: [ { "normal" :{ "font": "Burlington Script.ttf", "fontFamily": "sf_burlington_scriptregular", "fontName": "Burlington Script" }, "bold" : { "font":…
Yeak
  • 2,470
  • 9
  • 45
  • 71
0
votes
1 answer

AngularJS - Data binding not working

Sorry, english is my second language. Here is my problem. I had bound two textboxes to the scope. Each textbox needs to affect the other on changes. You'll understand that it cause conflict. From now, I've got that :
0
votes
2 answers

ng-model data bing not working properly

I'm trying to update a field with a new geo code value, but even though the model is updated it is not binding with first call. My controller code is as follows: function TheReportCtrl($scope) { $scope.code = []; $scope.code.lat =…
Gayan
  • 2,750
  • 5
  • 47
  • 88
0
votes
1 answer

AngularJS ng-model for select is not setting the selected="selected" attribute

I have an AngularJS page for editing surgeries, but I can't get any of the