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.
0
votes
1answer
35 views
AngularJS ng - repeat, ng - model on input text strange behaviour
i am new to AngularJS, i try and do the code below
var app = angular.module('SomeApp', []);
app.controller('QuotationController', function($scope) {
$scope.init = function(){
$scope....
1
vote
1answer
24 views
Angular access in controller to ng-model in nested ng-repeat
I have problem as in the topic. Using $parent in ng-model didn't help.
What I am trying to achieve is 2 clickable buttons to increase and decrease quantity field value by one and display summary (sum ...
0
votes
1answer
32 views
How to make a jQuery input validation function work with Angular templates?
I am using a jQuery function to auto-process forms, and show errors just as they occur using jQuery. I am also using Bootstrap 3.
(function() {
// Form Processing
$('input').each(function() {
...
1
vote
2answers
46 views
push checked checkbox value with multiple ng-model
I have days option for user.
My expected output will be, when a user click submit
if monday and tuesday is selected it should be [1,2]
if weekdays is selected it should be string 'weekdays'
I have ...
0
votes
1answer
165 views
Translate ng-model value in input
I'm trying to translate a value in an input. The input is disabled when I need to translate it so the user can't type text in the textbox. The data is inputted using ng-model and currently looks like ...
0
votes
1answer
24 views
How can I handle isDirty in a component?
I'm using Angular 1.5 and am creating a custom drop-down. There are no elements that use ngModel involved. I want to be able to have a form know if my component is dirty, pristine, etc. My thinking is ...
1
vote
1answer
26 views
Angular ng-model throwing a parse error on select input name
I have a client supplied Saleforce form that has a generated name value on the state selector in the form. Angular is throwing a parse error when run. I'm guessing it doesn't like the name, though I ...
0
votes
1answer
12 views
Replace , with . in input field bound to property using Angular 1
I have an input field that is supposed to contain numbers.
It is bound to an object property.
I want input entered as 4,5 to automatically get converted to 4.5 in both model and view.
HTML:
<...
1
vote
3answers
47 views
AngularJS - check if fields of model are the same with the initial values
If I have the following object $scope.object1 which looks something like this:
{
"firstName": "Name"
"lastName": "Name"
"startingDate": "08/Nov/2016"
"endingDate": "16/Dec/2016"
"description": "...
0
votes
3answers
61 views
AngularJS add/remove function with ng-repeat and ng-model
I'm creating a form that has add/remove function. To achieve that, I tried to use ng-model in ng-repeat. Here's what my code looks like.
<button ng-click='add()'>Add more</button>
<div ...
0
votes
1answer
35 views
How to call a function on click of date in html 5 datepicker input type
I had a html5 date-time picker.Now on mouseclick(select) of date from date picker I want to call a function.I wonder how can we do that in angular js ...can
someone help me.
html:
<div class="...
0
votes
0answers
68 views
Unable to post ng-model data
I have an angular app that consists of a three tabbed form. Each tab is using its own controller and designated service.
When the submit button is pressed on the form, the function found in ...
2
votes
4answers
76 views
Directive with ng-model Attribute Not Resolving Using $http
Trying to make a rating directive but I'm stuck at getting rating2 to work. The first rating worked because the rating1 is hardcoded within the controller. But normally I have to get the saved rating ...
0
votes
1answer
84 views
How to call a function from ng-model along with ng-model value
I had a div with text field where I am capturing the value using ng-model .I want to call a function as I enter some date in the text field for some validation.So I want to call the function from ng-...
0
votes
2answers
76 views
How to use ng-model in Angular.js?
I'm new to Angular.js . The problem is with my ng-model and ng-option. I have a data which shows code number with city name in my dropdownlist. I have made some changes to show only the city ...
0
votes
0answers
26 views
Dynamic elements and ng-repeat and ng-model
I'm having a problem. Within a ng-repeat I need to create dynamic inputs for different types of items depending on their type:
T01 dynamic input type toggle
T02 dynamic input type toggle
T03 dynamic ...
0
votes
2answers
40 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
45 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
36 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 ...
3
votes
1answer
5k views
Angular using $index in ng-model
I have the following loop in which I'm trying to increment several fields based on the array index each time through the loop.
<div class="individualwrapper" ng-repeat="n in [] | range:4">
&...
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
30 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
25 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
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
3answers
32 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
20 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
3answers
997 views
AngularJS : How to change a value in all items in an ng-repeat
I have a data model that comes in, by default I give the first ticker a selected status of true.
Now when a user clicks another item, I need to efficiently deselect all the others and set the ...
1
vote
2answers
894 views
AngularJS: ng-model setter inside ng-repeat
I've found some great answers on how to get the value of an ng-model inside an ng-repeat, but so far, I haven't found any that cover the setter. Suppose I have something like this:
<div ng-repeat="...
0
votes
2answers
31 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
18 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
20 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
13 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
39 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
98 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
38 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=...
4
votes
0answers
125 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 ...
1
vote
2answers
56 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....
0
votes
3answers
74 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>
...
3
votes
0answers
77 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
32 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> ...
-1
votes
3answers
4k 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 ng-...
0
votes
4answers
76 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
81 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 ...
1
vote
2answers
815 views
How to cancel debounce in ng-model-options in AngularJS
<form name="editForm">
Title<input ng-model="task.title" type="text" name=taskTitle ng-model-options="{ updateOn: 'default' ,debounce{'default':2000000} }">
<a ng-click="...
0
votes
1answer
42 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
26 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
141 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';
...
0
votes
1answer
136 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 &...