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.

learn more… | top users | synonyms

0
votes
2answers
36 views

ng-model returns name of value in place of real value

I have html page using angular. I have a table with ng-repeat on array: <tr ng-repeat="oblig in Obligations"> oblig object contains property of chargeOptionId connected to another array ...
-1
votes
1answer
38 views

AngularJS Form and $scope not updating each other

I am trying to make a very minimalistic form in AngularJS (version 1). I am trying to use ng-model and the $scope to update an object I've named fluff. Once a user clicks submit it should be used in ...
0
votes
2answers
25 views

Angularjs textarea ng-model object property each line

I am using angularjs and I am looking for solution to use textarea and ng-model two way binding between each line in textarea and specific property in array of objects. For example: The array will ...
1
vote
0answers
22 views

My controller doesnt recongnize the value inside ng-model

heres my root: .when('/form', { templateUrl:'../MyApp/Inventaire/tmpl/inventaire.html', controller: 'inventaireCtrl' }) My problem is,when i set a scope variable in my ...
0
votes
1answer
28 views

angular/angular-material: replacing a HTML slider doesn't update its ng-model

$scope.$watch("checkbox", function(newVal, oldVal, scope) { var newmax = calcNewMax(); var slider = angular.element(document.querySelector("#slider")); var parent = slider.parent(); ...
0
votes
0answers
24 views

Where is this ngModelController example saving values to

To understand ngModelController within directives I'm working through this example: Understanding NgModelController By Example There's one part I cannot figure out though, which is within the single $...
0
votes
3answers
29 views

angularjs textarea model with \n should start new line

I have sample json as shown below and I am trying to represent key in label and value in textarea (Plunker). But the textarea is not working if the model contains "\n". Whenever there is a \n I would ...
0
votes
1answer
16 views

Change md-input-container input type depending on var value

I want the input type of a md-input-container to be either text, a number or a date depending on the value of something I have defined in the scope. To do that I created 3 different containers that ...
0
votes
1answer
31 views

Input fields like textbox, select are not cleared on submit

var app = angular.module('myapp', ['ngMaterial']); app.controller('nameController', ['$scope', function($scope) { alert("controller called"); $scope.addNewName = function() { $scope....
0
votes
2answers
21 views

Can't get input value in Angular (Ionic)

I'm new to Angular and Ionic and I have problem with getting value of input. I get "undefined". Here is my code: .controller('myCtrl', function($scope) { $scope.submit = function () { ...
0
votes
0answers
14 views

Angular ng-model strange behaviour with KendoUI combo-box input

i have this part of code Html: <select kendo-combo-box ng-model="selectedData[field]" k-options="comboBoxOptions" data-bind="true"> </select> JS $timeout(...
0
votes
0answers
24 views

AngularJS bind and replace text [duplicate]

I am new to AngularJS and I am struggling with this.I am using MVC 5 to create a form. I have an input text where people enter some text (Note the ng-model): <div class="form-group"> ...
0
votes
2answers
18 views

Getting ng-model value onclick angulajs

I want to get ng-model's value in angular function <div id="script"> <div ng-repeat="selected in multiselectfields" id="generatedscript" ng-model="script"> "Insert into {{selected}} {{...
0
votes
2answers
11 views

angular ng-model updates parent object after submission and stay bounded

I have a form and a display fields above it. I want to update display values only after submission. This works fine for the first submit. Until I submit it, values don't change, and once I click ...
1
vote
1answer
36 views

Use angular ng-model ,Can not get the default value of radio

when the current form submission,when clicked, you can get the value of the value, but no click can not be obtained,I have already set up the initial value <form class="form-css" name="myForm" ...
0
votes
1answer
53 views

Angular2: Unable to set initial value from ngModel on input type=“date”

I am unable to get an initial date when using html5's <input type="date> Here is what I have <input type="date" [(ngModel)]="testDate" /> in the component (this is in typescript) I am ...
0
votes
1answer
33 views

Angular.js searching API URL with user input

I am trying to search for an URL using user input. Currently I can search through textinput where the first three letters of a city is in the URL. For example; if I search for "sto" the URL is "find?q=...
1
vote
2answers
44 views

Angularjs scope error

need some help on angular i have no knowledge on, but i have a work to do ^^' . My problem is when i write into my inputs i can't get the ng-model return and get a scope error telling $scope....
3
votes
0answers
64 views

Expression in ng-model AngularJS

I need to execute an expression inside ng-model. I have an array of integers which is shown in a list and input fields needs be generated on click of each item. All input fields should carry a ...
0
votes
3answers
47 views

AngularJS: How to bind ng-model to an 2 dimensional array

I am newbie in AngularJs. I would like to create multidimensional array element in ng-model as defined below. <Ojbect> <Array> <Element1> <var1> ...
0
votes
3answers
30 views

Angular show elements, radio button

in Angular I'm doing something like this to show and hide elements when a links is clicked. <a ng-click="showEle = !showEle"><span ng-bind="showEle ? 'Hide' : 'Show'"></span> ...
0
votes
4answers
64 views

Datepicker not working on form populated through angular scope variables

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="https://code.jquery.com/...
2
votes
3answers
72 views

ng-selected is not working with ng-model in select box - Angularjs

While ng-model is used in select box and ng-selected is also used in options with some condition that time ng-selected is not working. If I will remove ng-model than ng-selected is working, but if i ...
0
votes
0answers
18 views

Multiple models inside directive

I get a problem with my products-totals directive. When I'm changing a model value this one is not updated on the view. If I want it, I must change the model value of scope.$parent (like my comments ...
0
votes
1answer
40 views

How to get label of an input field when submit a form in Angular JS

What I want to achieve is when I submit the form it should return the label of the option I choose in the console but it is returning me the value of the option. Expected Result: DXBA-sky Result ...
0
votes
1answer
24 views

Extending input by using my own service

I want to extend input of type text in angular in such a way that after user enters some text, the text value is passed through a custom filter that do some purification on entering input, here is ...
0
votes
2answers
124 views

How to include module in Angular 2

I'm new in Angular 2 and I'm following "The hero" tutorial. I need to import these modules: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; ...
4
votes
0answers
94 views

Angular Twix Editor does not send value with ng-model

I have a problem. I want to add text editor on my page. I choose Angular-twix editor. I added on my page and connected with controller. I initialize first value for text editor. There is no problem to ...
0
votes
0answers
38 views

How to bind an allowed new value (free text) using angular js with jQuery chosen plugin

I am using jQuery chosen plugin with angular js for multiple selection in my application. I am able to display new value (free text) inside input box by modifying jQuery chosen library. I want to ...
0
votes
1answer
48 views

How to change input value to max value if it reaches the {max} AngularJS

I have a form it includes input field which you can enter the amount of money. It has max attr. and if user entered amount of money greater than the max value I would like to set the ng-model ...
0
votes
1answer
52 views

How could I get data for angular from handlebars when the page is rendered

I render the handlebars template with data. var express = require('express'), app = express(); var handlebars = require('express3-handlebars') .create({ defaultLayout:'main', ...
1
vote
1answer
29 views

Reducing ng-model boilerplate code (DRY)

Using ng-model, the sign in form in our app has ended up looking something like this: <form name="signIn" ng-submit="ctrl.signIn()" novalidate> <label class="item item-input" ng-class="{'...
0
votes
1answer
55 views

ng-model versus getElementById

I am reading the book "Pro AngularJS" by Adam Freeman, Apress. He creates an app that is a to-do list and you can add your own things on the list. In the part "Responding to User Interaction", page ...
0
votes
1answer
95 views

angular directive to convert ASCII or html codes in special characters in a textbox or text area

Here is the challenge I am facing with angularJS text boxes. I want to auto convert all the HTML codes and HTML Name into special characters inside a text-box. Suppose, {$sce.trustAsHtml('Tom &...
1
vote
2answers
41 views

Trouble binding complex input to variable, efficiently

I'm new to Angular and trying to learn. I am trying to find a way to bind some Quantities with their IDs. Here is my template: "<div class='tableBorder'><label> <input ng-model='" + ...
0
votes
0answers
177 views

click on card to open 'details' view in ionic

I cannot find an example on how to make a ionic card clickable. The behaviour I want to implement is to be able to click on each card my app has (and has lots of them) and get a modal view open with ...
0
votes
1answer
64 views

AngularJS: How to use directives to dynamically remove class from all elements with specific ng-model?

The solution I'm trying to attain in a nutshell, is deleting the class clicked from every element with a certain class name or ng-class name or ng-model name, then adding the class name on the button ...
0
votes
1answer
69 views

The model is updating, but not the UI

I am using the ion-datetime-picker in my ionic project. Everything works fine when I debug it in web browser. When I run it on real device, I found a problem. The input text doesn't update. I check it ...
0
votes
1answer
45 views

AngularJS Ionic using ng-model between two controllers

Well, try to update my code to use both .value and .factory to clean and optimize my App... Now, my services.js looks like : // Définition des données lues par le scan du code barre .value("ScanDatas"...
0
votes
1answer
111 views

Using AngularJS ngModel and Form Validation to $watch two elements and test if they are equal whenever either input changes

What I am trying to do is create a directive which compares two password inputs and triggers invalid if either changes. I have found a few examples and have tried a few and have combined a few in my ...
1
vote
3answers
117 views

Angular : ng model array values got undefined in function on ng-click

I am trying to allow users to add quantity into text box. I have products array and each product contains its property. My service contains array list. products = [{ id: 1, name: 'X Product', ...
0
votes
1answer
19 views

angulars, directive, force ngModelCtrl.$parsers

I have a custom directive on that change the view value add classes to an input:text based on his value. restrict: 'A', require : 'ngModel', link : function(scope, element, attrs, modelCtrl) { ...
0
votes
2answers
37 views

How to use one controller for multiple inputs with the same logic?

I have the following scenario, one form with multiple inputs and i need to calculate every input the same way but return the values to different fields <div class="row"> <input type="...
1
vote
1answer
28 views

controller function sees old version of the variable

I'm trying to hook a few variables up to a function in AngularJS and while they appear to be making it to the front end, the changes made on the front end don't transfer to the back end. Here's the ...
0
votes
2answers
142 views

Copy JSON Object of One Select to another Select ng-model using AngularJS

I'm having a JSON Collection $scope.person = [ { "Id": 1 "Name": "John" }, { "Id": 2 "Name": "Jack" }, { "Id": 3 "Name": "Watson" ...
-1
votes
1answer
48 views

Angularjs: ng-model not displaying properly

I have a parent and child controller relationship. This is a non-working mockup of the basic functionality. I'm sure anyone more competent than me can get it working for a Plunker or Fiddle model. (So ...
0
votes
1answer
36 views

No ng-model updates when input is focused

I am making a directive that will block render on a input while it is focused. The use case is that we receive frequent live updates from the backend, and it will overwrite anything the user is ...
2
votes
1answer
277 views

require ngModel syntax in AngularJS

I see the following: // my-directive.js return { require: 'ngModel', scope: { ngModel: '=', }, controller: controller, link: myLink }; // my-link.js return function(scope, $element,...
1
vote
1answer
32 views

Bind input model to every object in array

I have a simple input like this: <input type="text" ng-model="myModel" /> and an array in my controller like this: myApp.controller('MyCtrl', function($scope) { $scope.arr = [ {...
0
votes
2answers
46 views

Why angularjs change variables that are different?

I am getting an ajax data from api and saving it to a variable. And I have to "edit and save" or "edit and cancel" changes on this data. I am using ng-model to show and edit this data. Here is my ...