Used in Angular.js - The ngModel directive 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

1
vote
1answer
24 views

AngularJs Avoiding Scoping Issues

I recently spent over 4 hours before figuring out why my ng-model directive used in combination with ng-options was not correctly binding to the property within my controller. The <select> ...
0
votes
3answers
33 views

Run function only the first time the user types in form input

This should be straight forward but haven't found a solution yet. I have an input in a form. I want to detect when a user has interacted with the input and run a javascript function once if they ...
0
votes
1answer
12 views

Access html element via ngModel

Imagine something like this: <input type='text' ng-model="x"> Now, using x in the controller, how can I change this element? let's say I want to change its class. Or add a random element ...
1
vote
3answers
15 views

How to target ng-show on specific items in ng-repeat?

http://plnkr.co/edit/aiGCPJEwTj0RWnuoCjsW?p=preview I want the remove button to only show the popover for that item. How would you go about this? HTML: <li ng-repeat="acc in accounts"> ...
0
votes
1answer
18 views

Can I init an Angular ngModel in html, and then use its value in controller?

html: <div ng-controller="MyController"> <form> <!-- one way to do it --> <input ng-model="var1" value="1"></input> <!-- another way, not approved per angular ...
1
vote
0answers
21 views

ng-model on <input type='number'> dosen't allow to have characters. AngularJS, ionic

I have a input which needs to trigger number keypad on a android device.As per my understanding, type='number' will do that for me. But I need to show a mask in the place of user's input after one ...
0
votes
1answer
27 views

Is it possible to bind and unbind an element on button click? - AngularJS

I created a display text and an input field and bind them together with ng-model as follow. HTML <div ng-app ng-controller="test"> <div ng-bind="content"></div> ...
0
votes
1answer
27 views

How do I convert from ngOptions to angular-ui-select?

I'm trying to add searchability to my select with the angular-ui-select directive. When I use angular-ui-select, the model value turns into the entire timezone, not just the id. Here's the code: ...
1
vote
2answers
42 views

Ionic / Angular JS - $scope issue : Cannot read property 'length' of undefined

I can't use $scope in ionic, it seems that's $scope is not working. Let's see very simple example : App.js : angular.module('TestApp', ['ionic','TestCtrl']) .run(function($ionicPlatform) { ...
0
votes
0answers
19 views

angularjs ng-options advanced filter

I'm trying to create a custom filter for use with ng-options - but I already have a working filter setup for the other fields and can't seem to get the ng-options field to filter along with the ...
0
votes
1answer
27 views

How can I be notified of angular setting the value of an input field via ng-model?

See this fiddle. I've got a simple directive in which I just log the value of the checkbox that it's added to: myApp.directive('myCheckBox', function () { return function (scope, element, attrs) ...
0
votes
1answer
31 views

ng-model weird behavior with Asynchronous function

Below is drop down selection code : <select ng-model="filter.area"> <option value="">Select your location</option> <option ng-repeat="area in areaNames" value='{{ ...
0
votes
1answer
33 views

How to convert/escape HTML in Angular?

^ Above is what term.search_preview renders in my templates. Current HTML: <div class="term-context-preview" value="{{term.term}}"> <p ng-bind-html="term.search_preview"> ...
1
vote
3answers
20 views

Angularjs ng-model with number input

I'm trying to retrieve an input[number] in my controller. I found a solution which said to add a $scope.$watch on the input. I tried it but now my number is "NaN". <div class="offerText"> ...
0
votes
2answers
18 views

Angular ng-model issue on time input

I'm having an issue using ng-model with time input on my app. I've searched around and couldn't find any other questions regarding this but I may be mistaken. I have time inputs with ng-model and am ...
0
votes
3answers
48 views

two way binding not working with ng-repeat

I have a simple ng-repeat list, in which i am assigning current list item value to another property on the controller as follows: <li ng-repeat="num in list"> <input type="text" ...
1
vote
2answers
20 views

Delete ng-model input value in ng-model

I have question about ng-model in ng-repeat. I prepared example. https://jsfiddle.net/0ff3btv2/1/ Basicaly I can create ng-model in input and delete its value by clicking button like this: ...
1
vote
2answers
28 views

angularjs ng-repeat determine what item is clicked

Im loading objects into clickable boxes using ng-repeat. now i want to return the objects title when the user has clicked its item-box normally i would put it in a ng-model but since im using ...
0
votes
1answer
15 views

How to get formData from Angular-Payments

I am using Angular-Payments that intercepts the form data and submits it to Stripe. This works well, however, I'm not sure how to access form data after its sent to stripe. For example, my form has ...
0
votes
1answer
20 views

How to calculate a dynamic value with ng-repeat for a nested object property in AngularJs

I want to calculate taxes in relation with a user-input that correspond to the price. I have no problem when I don't use ng-repeat. But I can't figure out how to make it works with ng-repeat. For ...
0
votes
1answer
30 views

Angularjs input radio and ng-repeat issue

Okay so here is my setup i have the following array: answers = [answer1, answer2] with these i do the following: <form> <div class="col-xs-12" ng-repeat="answer in ...
1
vote
2answers
40 views

How to update ng-class based on ng-change?

I have an ng-repeat that creates several widgets, each with it's own select dropdown. <div ng-repeat="item in widget.items" class="col-md-6"> <select ng-model="item.chosenTag" ...
0
votes
2answers
28 views

How to get changed value of a select in Angular - Without updating a global model?

I have several widgets which are generated from JSON data and an ng-repeat. Inside this widget is a select dropdown. I'm able to call a function in my Controller with ng-change, however using ...
0
votes
3answers
36 views

ng-controller not passing value to view

<html> <head> <script src="angular.js"></script> </head> <body> <div ng-app="myapp1"> <div ng-controller="cont1"> ...
0
votes
1answer
20 views

ngModel needs $parent when within Transcluded html

I have a directive for a input field that uses transclusion to take the elements that are enclosed in the directives element which includes an ng-model attribute. After reading countless SO questions ...
0
votes
2answers
31 views

Select menu, match json list with singular value

I have a JSON file of the US states, name and 2-letter code bound to a menu via a factory/controller variable of usStates [ {"name":"Alabama","code":"AL"}, {"name":"Alaska","code":"AK"}, ...] So, ...
0
votes
1answer
21 views

AngularJS - Inherit ngModel in custom directive

I have a custom directive like this: myText.html: <div> <label>{{label}}</label> <input type="text" class="form-control" > </div> Javascript: app.directive("myText", ...
1
vote
1answer
34 views

Angular JS - How can I get the ngModelController by its model name?

In my custom directive, I need to update the validity of another input. The directive is something like this : <customDirective="foo">, in which the value foo is the name of another ngModel. In ...
0
votes
1answer
34 views

Angularjs email form field not clearing/resetting after model binding reset

Hey so I have a form which has three fields name,email and phone. <div ng-show="Nerd.adding"> <form class="col-sm-6" name="Nerd.nerdAddFrm" novalidate > <div ...
0
votes
2answers
23 views

Finding the SUM of PHP-looped elements + ng-modeling

I've created a table with a row for each day of the month. Each row has a few input fields for numbers. When someone types in a number, it shows it in within element to the right of it. I've used a ...
1
vote
4answers
48 views

Two inputs with one way binding in ng-model

I try to make an application which have two inputs text (say parent and child) , each one has ng-model . I want to make it one way binding , mean , change in the parent input should display the same ...
0
votes
2answers
94 views

AngularJS: How do I access ng-model values injected from custom directive template?

I ran into a problem with AngularJS concerning directives and ng-model. Assume the following example: Within my HTML file: <div ng-controller="MyCtrl"> <div ng-repeat="item in data"> ...
0
votes
2answers
40 views

Angular ng-model not binding to input fields

I have the following controller working and I can use ng-repeat to display the ONE json object I have. I just used ng-repeat to make sure the data was actually coming across. But I can't figure out ...
0
votes
1answer
28 views

Select not selecting when binding with ng-model and ng-options

Here's my select: <select class="form-control" ng-options="assistanceType as assistanceType.name for assistanceType in assistanceTypes" ng-model="selectedRecord.assistanceType"></select> ...
0
votes
1answer
41 views

How dynamically add new input element if all others was filled in AngularJS

please watch this Plunker So I working with angular and need to add new input field when all others are filled in (by default on page placed 5 inputs and if all of them are filled automatically add ...
0
votes
2answers
48 views

AngularJS, how do I combine multiple inputs into a single ng-model? Specifically, to combine a date, time, and timezone input into a datetime object

I need to create a datetime object to store in MySQL, but I need it to be entered with multiple inputs (one for date, one for time, one for timezone). So right now my code is like this: <input ...
0
votes
0answers
50 views

material design angular input require

Does Angular Material Design require an input ng-model to be equal to a variable in order for required to work? Without using Material Design, the following error checking works perfectly fine. ...
0
votes
1answer
96 views

AngularJS $scope values from ng-model lost from page to page in same controller - Ionic Framework

I have this page which links the input.countNum scope variable to the input with ng-model. The value which is displayed on the button shows fine. When you click the button on the first page, it ...
0
votes
1answer
55 views

How to track behavior of ngModel array item using .directive

Hi everyone I'm use angularjs not so long time ago and now I have one issue related with this framework that i can't to solve. So the problem in next: I have few input fields that generate via ...
3
votes
2answers
47 views

Why won't the model be updated in this recursive Angular directive?

This has been baffling me all day. Why won't the names update when I type in the text fields? Everything is by the book. What could be going wrong? To summarize: I'm trying build a recursive ...
2
votes
2answers
37 views

ng-model throwing error on input type number in angular 1.3

I have an input field which I want he user to input a number, so I have made an input field with type="number". When I use it in 1.2 I get no errors <script ...
0
votes
1answer
62 views

Angular Js ng-model not updating variable in an inner function

I have the following code in my controller: appControllers.controller('myCtrl', [ '$scope', function($scope) { $scope.timeFreeze = false; $scope.ws = new WebSocket("ws://localhost:8080/ws"); ...
0
votes
2answers
53 views

How to programmatically uncheck checkbox?

I want to programmatically uncheck a checkbox. I know how to it in javascript but since I'm using angular, i think it's different. Here's the link of jsfiddle : https://jsfiddle.net/TKVH6/499/ This ...
0
votes
0answers
31 views

Prevent angular select from initially updating binding to inexistant model

In angular i have a select with ng-model binding. However that particular part of the page with the select is not visible yet and also the indended model behind the binding doesn't yet exist (it gets ...
2
votes
3answers
86 views

Not getting the updated value of ng-model when ng-model is changed programaticaly

When I check master check-box all the children check-box should be checked and their content should also be shown when check-box is checked otherwise their content should not be shown but the issue is ...
1
vote
1answer
159 views

angularjs: custom directive to check if a username exists

I have my registration form with textbox username. I want to do is when the user enter the username, the custom directive will check if the entered username is exists in the database. directives.js ...
0
votes
3answers
51 views

angularjs update model based on sum of other fields

I want to be able to update a value in my data model based on the result of two other fields. using <td><input ng-value="s.hours*s.rate"></td> I have no problem calculating the ...
0
votes
0answers
61 views

Angular ngmodel doesn't render select ngoption when model value is the number 0

I have the following test code: Html <html xmlns="http://www.w3.org/1999/xhtml" ng-app="myApp"> <head> <script src="angular.js"></script> <script ...
1
vote
1answer
77 views

pass the ng-model value to angular directive

I have a scenario where I have certain number of text-boxes and when I click on any of the text-box, its corresponding ng-model is to be printed on the browser console. I have written the following ...
0
votes
1answer
33 views

ngModel Changing to Child Scope

When I edit a value through an input field that is bound (perhaps bound isn't the right term) to a parent controller's scope, it seems to re-bind to the child controller's scope. This eliminates my ...