FAQ Database Discussion Community


Getting Select box value in Angular - without using ng-options?

angularjs,angular-ngmodel
I'm trying to modify a form which is using a select box that is populate NOT using ng-options. The form itself is bound to an angular controller. Is there still a way for me to know the selected value of the select box even though the select values were not...

pass the ng-model value to angular directive

javascript,angularjs,angularjs-directive,angular-ngmodel
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 angular code: <html ng-app="myApp"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.0/angular.min.js"></script> <script> var app = angular.module("myApp", []) app.controller("myAppCtrl",...

AngularJS Show List Items based on ng-model

angularjs,angular-ngmodel
I'm trying to create some functionality where the user would have an input box and all the data (li's) below are hidden. Then when a user types into the input box, those li's that match that text are show. What would the best way to do this using angular? I've...

Do I need 2 ng-models for this?

javascript,angularjs,angular-ngmodel
I'm trying to create a form where the input fields are populated with values from an array, but the form is saved into a different array. For example the fields would be populated from this array { "organisation": [ { "OrgID": 1234, "OrgName": "Organisation one" }, { "OrgID": 4567, "OrgName":...

ngOption default selected option

angularjs,angular-ngmodel,angular-services,angularjs-ng-options
How to have a default option in select box...I tried several options and do not get it I tried creating a scope on my contralador with the value of the object that comes from json: Like this: $scope.productSelect = $scope.item[0]; this my code: html: <select id="variant" class="form-control variant-select" ng-model="productSelect" ng-options="product...

Angular ng-model on input not binding within ng-repeat

angularjs,angularjs-ng-repeat,angular-ngmodel
I'm trying to get the input entry {{post.title}} to post upon submit, but only {{post.upvotes}} is posting. Can anyone see what I might not be seeing in my code? The result when I submit is - upvotes: 0 When I change {{post.title}} to {{title}}, it posts fine, but I can't...

Two inputs with one way binding in ng-model

javascript,angularjs,angularjs-directive,angularjs-scope,angular-ngmodel
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 value in the child , and change in the...

ngModelCtrl - $setViewValue without $setDirty();

javascript,angularjs,angularjs-directive,angular-ngmodel
I have a directive which manipulates the $viewValue of an input field via ngModelCtrl.$setViewValue() on blur. function _onFocus () { presentation = false; if(!ctrl.$isEmpty(ctrl.$modelValue)) { ctrl.$setViewValue(String(ctrl.$modelValue).replace(/\./, ',')); ctrl.$render(); } } Plunkr Since this is only an appearance thing, I wonder if there is the possibility of setting the ViewValue without...

Angular query on mobile

javascript,angularjs,angular-ngmodel
Simply I am using ng-model="query" on my project as a search. It works great but for some reason it won't work on mobile (specifically iphone 5s). Is there any reason for this? I have tried searching for answers on google and haven't come up with anything.

Updating a value based on a range of inputs in AngularJS

javascript,angularjs,angularjs-ng-repeat,angular-ngmodel
What I am essentially trying to achieve here is to have a remaining amount that decreases in amount as the user enters the amount in to a series of text fields. These text fields are generated by an angular loop and its the remainingAmount var that I need to be...

Parsing data to ng-model not working

angularjs,angularjs-ng-repeat,angular-ngmodel
I'm trying to parse data to ng-model, but I'm getting an error. html: <div class="process-checkbox-holder" ng-repeat="time in data"> <div class="checkbox-title">{{ time.id }}</div> <div class="process-checkbox"> <input type="checkbox" ng-model="{{ time.model}}" value="None" id="process-checkbox" name="check"> <label for="process-checkbox"></label> </div> </div> data: $scope.data = [ {"id":"00", "model": "user.hourzero"}, {"id":"01", "model": "user.hourone"}, {"id":"03", "model":...

How to programmatically uncheck checkbox?

angularjs,checkbox,angular-ngmodel
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 is the first time I used jsfiddle so please let me know if you cant see the script and...

ngModel Changing to Child Scope

angularjs,angular-ngmodel
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 ability to affect the value with functions built into the parent scope (clicking the button...

ng-model and value combination not working for input text box

javascript,angularjs,input,angular-ngmodel
I'm having two input text box. I need to combine the values entered in two text boxes and display it in the third. I'm able to display it if I use only the value in the third text box. Box 1: <input type="text" ng-model="entity.name"> Box 2: <input type="text" ng-model="entity.code"> Box...

Change selected