Binds the given expression to the value of or input[radio], so that when the element is selected, the ngModel of that element is set to the bound value.

learn more… | top users | synonyms

0
votes
2answers
30 views

How to use both ng-value and ng-class without duplication?

I have an input which uses ng-value with a filter to display a number. <input ng-value="myDataCollection | customFilter"> I want to also apply ng-class to change the text colour to red if ...
1
vote
1answer
44 views

ng-model not working for angular radio buttons with JSON object as values

I have a simple filter where I want to select a particular value and type and make other calls using that. Here is a close representation of what I have in my view (I am not using ng-repeat to create ...
0
votes
0answers
24 views

AngularJS - Why ng-value overrides value attribute and how to avoid it?

So, I have the following code: <input ng-model="refreshedByExample" type="text"> <select ng-model="example" ng-change="refreshedByExample = example"> <option value="1" ng-value="...
0
votes
2answers
49 views

Angularjs ng-value sum fields

Hi i have inputs like this <input type="text" ng-model="tbl.Public"> <input type="text" ng-model="tbl.Private"> <input type="text" ng-value="tbl.Public--tbl.Private" ng-model="tbl....
1
vote
3answers
329 views

how to use ng-init with ng-repeat

I am creating a web app in which i am using dropdown and angularjs for updating my database, this is my syntax of my dropdownlist <select ng-model="ucomname" ng-change="uucomname(o)"> &...
0
votes
2answers
31 views

Binding object values from radio input with ng-model

I have a json file $scope.favoriteThings = [ {nr: 1, text: "Raindrops on roses"}, {nr: 2, text: "Whiskers on kittens"}, {nr: 3, text: "Bright copper kettles"}, {nr: 4, text: "Warm ...
0
votes
1answer
145 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 &...
4
votes
3answers
2k views

Angular2 selected option with objects

I have an Angular 2 app that is dealing with customers and a spring rest back end. The customer object has a customer type, which is also an object, and I have the drop down on the customer form ...
5
votes
1answer
16k views

Default value of input textbox in AngularJS

How do I set the default value of an input textbox in AngularJS so that it can be altered later? I wish to be able to submit the changed value of the textbox(using ng-model) to the server. Would using ...
19
votes
4answers
21k views

whats the difference between ng-model and ng-value

As far as i understood ng-model sets the value for that particular element in which the model is been assigned. given that how is ng-value different from ng-model?
0
votes
0answers
34 views

How to get edited value from textfield to pass it to server - angularjs

I am new to AngularJS. I have a problem with ng-model. In one of my pages I have a list view. Each list can be deleted or it can be edited. What I need is when I click the edit button, I have to ...
0
votes
2answers
69 views

Blank select option #ngValue

How can I avoid blank option in the form output? <select class="form-control" ng-model="item.type" > <option ng-value="0">Real</option> ...
0
votes
0answers
298 views

One-Way or One-Time binding in Angular and Watchers

I have a question about how to avoid watchers when you have readonly input textbox in AngularJS. I have created plunker for it : plunker link : OneWay Binding using ng-value This shows that even ...
0
votes
3answers
486 views

Passing hidden value in angular

View: <ul ng-repeat="x in posts.post"> {{x.name}} {{x._id}} {{x.post}} {{x.user_id}} <br> <ul ng-repeat="y in x.comment"> {{y.comment}} </ul&...
3
votes
1answer
133 views

Angularjs: when use ng-value, value = 0?

I got one weird error. When I use ng-value, the page render a 'value=0' for some options. The console doesn't show errors. Here is the code: <option ng-repeat="x in makes" ng-value="{{x.make_id}...
0
votes
2answers
270 views

In Angular, unable to bind to a radio button in a directive on page load

CURRENT SITUATION: I have form fields that are dynamically created via a directive. One of the types includes radio buttons. GOAL: On page load, I need to bind the values of these elements to a ...
0
votes
1answer
273 views

ng-repeat radio button 2-way binding issue, only last item set correctly

I am using angularjs to repeat radio button groups with the following code. <div class="row observation-point" ng-repeat="observationPoint in question.observationPointList"> &...
1
vote
0answers
53 views

How to show truncated number in ng-value

Let's assume that in my controller I have the following variable. $scope.power = 16.345865; In the html file I would like users to be able to modify (if they wish) the value of that variable. I want ...
0
votes
0answers
367 views

Angular: Set value of text input without creating a model

I have a form that lives inside an ng-repeat. I'm not using ng-model on the form because I don't think there is a need just yet (it's not an AJAX form). I want to set the default value of one of my ...
0
votes
3answers
1k views

Angular ng-value doesn't work with input radio

I have 3 radio inputs bound to ctrl.poiType , where ctrl is the controller and poiType is an integer. ctrl.poiType can have one of the 3 values specified by four constants (ctrl.TYPE_TRIP, ctrl....
1
vote
2answers
626 views

Angular - Adding an input's value with a number from $scope

I have the following code: <div data-ng-controller="MainController"> <input class="amount" type="text" name="" value="" /> <input class="result" type="text" name="" ...