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.
2
votes
0answers
33 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
22 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
21 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
33 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
51 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
16 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
39 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
19 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
107 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';
...
3
votes
0answers
42 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
27 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
26 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
44 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
26 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
31 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
62 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
40 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
1answer
66 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
55 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
61 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
30 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
71 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
83 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
17 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
31 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
27 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
89 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
45 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
34 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
93 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
30 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
42 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 ...
0
votes
0answers
25 views
angularjs lookup values from one model into another model
I am trying to lookup values from one model into another model. How do i achieve this in angular?
Model1: Insurer
Model2 : currentItems
I want to filter Insurer model based on values in ...
1
vote
4answers
64 views
How to use ng-model as element rather than attribute?
I want to use ng-model directive as element rather than as attribute inside tag,is there any way to do it?
well I've already designed my webpage in html and javascript and I want to include it in ...
0
votes
1answer
140 views
Why ng-Model is not updated in HTML input element when I set element.value in JavaScript?
For example I have HTML input field:
<input id="firstName" ng-model="applicant.firstName" type="text">
<button ng-click="updateFirstName()">Update</button>
<h4>See content of ...
0
votes
2answers
88 views
How to remove key name from AngularJS object and keep it's value?
I have checkboxes for the days of the week. I am using ng-model however cannot use the same model for each as it prevents multiple boxes from being checked. So, as a work around I have used the ...
0
votes
1answer
53 views
how filter Angularjs result by trimmed ng-model
I have three input boxes to filter field "tradeDate"
<input type="text" placeholder="Date YYYY" ng-model="search.DateYear">
<input type="text" placeholder="Date MM" ng-model="search....
0
votes
3answers
52 views
How to convert 1 to true in markup for ng-model assignment?
This is my current ng-repeat code:
<li ng-repeat="tik in settingsModel.port_tickers">
<input type="checkbox" ng-model="tik.alert" name="tik.ticker" value="tik.ticker">
<p>{{ ...
0
votes
0answers
53 views
Angularjs http post won't send data if all form fields are populated
I am using AnglarJS. I have select tag on my form. On change I call function that sends http post and retrieves some data. It works when I before everthing select value from select box,then it gets ...
1
vote
2answers
48 views
ng-options bound variable is not updated after clearing the array
I'm using an array to populate a list with ng-options, and a property binded to the selected item. After clearing the array, the bound variable myObject.selectedItem keeps the value of the last item ...
0
votes
2answers
61 views
ng-model-option rollback changes on whole form
have a quick question.
I have a form with whole bunch of fields that could be updated from UI.
I found a directive called "ng-model-option" that seems to be handling those kind of issues.
My ...
0
votes
2answers
27 views
ng-model is not updating in Angularjs
Acutally I am learning angularjs. I've introduced a problem is that when I click ng-click, ng-model is not updating. My code is as follows,
<div ng-repeat="product in cart">
<input ...
0
votes
1answer
31 views
AngularJS input value as array not matching model
I'm building a sort by box to help sort my ng-repeated data.
My sort box currently looks like this:
<select name="day" ng-model="Events.orderAttraction" data-ng-change="Events.limit = 6">
...
0
votes
1answer
222 views
Binding dynamic values to ng-model of a check-box with in a ng-repeat
Inside my controller I have an array of objects like this:
this.set = [{
"display": "Name",
"pass": "name"
}, {
"display": "Subject",
"pass": "subject"
}, {
"display": "Batch",
...
0
votes
3answers
59 views
value of $index in the loop
I have an <input> element with a ng-repeat directive.
<input ng-repeat="table in tables track by $index" type="text" name="lastName" ng-model="user.$index">
I want the value of $...
0
votes
2answers
40 views
How to get ngmodel under ngrepeat binding to $scope
I have a json data from a api call which is like below procution_volumes array.
"production_volumes = [{period:'2014Q4', volume:'200', comment:'nothing'},{period:'2014Q2', volume:'300', comment:'...
1
vote
2answers
128 views
Using multiple ng-models in a single ng-repeat
I'm trying to get multiple values selected form a checkbox list generated using ng-repeat in anguler
<div ng-repeat="item in items">
<input type="checkbox" ng-model="model.ID" ng-true-value=...
1
vote
2answers
55 views
Using the ng-model
I am working on a save feature using angularjs, web api and entity frame work. When the user clicks add new button I initialize some fields to default values. I have an itemDetail object and an ...
0
votes
2answers
47 views
Angular radion button ng-model does not work
I wonder why the code below for radio button does not work. I cannot select any option from the radio buttons. It froze once I click any of the option. I was able to select and does not froze when I ...
1
vote
0answers
170 views
ng-repeat custom filter not working (angular + typescript app)
I am working on an angular application using typescript and trying to filter an ng-repeat using a custom filter. I was able to make it work using a jQuery function as filter, but I would like to have ...