The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
2answers
404 views

AngularJS - how to change the value of ngModel in custom directive?

Lets take a look to my directive: angular.module('main').directive('datepicker', [ function() { return { require: '?ngModel', link: function(scope, element, attributes, ngModel) { ...
2
votes
2answers
65 views

Directive to load different templates according to the model value received

I'm writing a directive that consists of an inline editor. When there is no value the edit box will appear. When there is value a regular span will appear. This is the template chunk of the ...
1
vote
2answers
1k views

angularJS element.on callback and scope.$apply

In this example, I have an input with an attached directive. The directive is meant to display messages next to the input. There's another input and a button to add messages. Once some messages are ...
1
vote
1answer
647 views

Why is Angularjs ng-pattern not working with the following regexp?

For some reason the initialized value doesn't appear in the field, but the second field without the ng-pattern does work. any ideas? angular.module('app', []).controller('MainCtrl', ...
1
vote
1answer
38 views

Why can't I use Angular an angular directive's $set function to set ngPattern, ngMinlength and ngMaxlength?

This is going to sound weird, but, even if it is bad practice or something, how would I get this: html: <div ng-controller='CtrlCtrl as ctrlr'> <input account /> <button ...
1
vote
2answers
24 views

Filtering content of one controller with model in another (AngularJS)

I have something similar to this: <div ng-controller="ControllerA"> <input type="text" id="search_form" value="Search" ng-model="searchModel" /> </div> <div ...
1
vote
1answer
105 views

Angularjs debounce for multiple events not working

I was looking at the Angular documentation for handling forms and found a very useful example for capturing the update in any field/control with a delay. Following is the sample code provided by ...
1
vote
1answer
56 views

What is the difference in behavior between ng-repeat and statically typed out code?

What is the difference between the html and the behavior produced by this ng-repeat code: <div id="settings-row-{{key}}" class='settings-row' ng-repeat="(key, value) in items"> ...
1
vote
1answer
387 views

ng-model from angular-payments is not working

I am trying to add angular-payments in order to integrate stripe.com payment processing to my AngularJS web app. I duplicated the code from ...
0
votes
2answers
92 views

Create ng-model dynamically with {{expression}} doesn't work?

I am working on an angular project where I need to create a form based on an array of questions. I would like to create ng-model for each question in the array. So I have come up with something like ...
0
votes
1answer
1k views

Get the selected text (not value) of select element in angular

For example I would like to do something like this: <select ng-model="persons"> <option value="person1">Anna Smith</option> <option value="person2">Karl ...
0
votes
3answers
111 views

Bind dynamic element creation to keypress with AngularJS

I am trying to append an element to the DOM from user text input using AngularJS. The desired behaviour is: User types string into input ng-model "newTask" Presses enter key Dynamic element is then ...
0
votes
1answer
30 views

Updating AngularJS models on ng-click, DOM not responding

I have an input box and a textarea that are held inside a modal window that is open upon a button-click. The same input box and textarea are in use by a second modal with a different purpose. Each ...
0
votes
1answer
20 views

Referencing the element that's calling a controller function Angularjs

Fairly simple but I can't figure out the term I need to google. How do I reference whichever element is calling the controllers blurr function? html <body ng-app="test"> <div ...
0
votes
1answer
30 views

AngularJS Model-level Helpers

I have a user model that looks like: { accessFailedCount: 0 active: false created: "2014-05-09T14:39:56.867Z" email: "[email protected]" emailConfirmed: false fullName: ...
0
votes
1answer
54 views

Generate random model name in ng-repeat

In my angular.js project, I have a loop which contains a input field <input type="text" ng-model="myColour"> <div ng-repeat="c in colors"> <input type="text" ng-model="colour"> ...
0
votes
2answers
42 views

AngularJS which scope does an ng-model point to?

Still training myself to think In angularian... I think that it would it be correct if I think of the ng-model attribute as a reference to some data element in some parent scope... [would it?] I am ...
0
votes
1answer
185 views

angular js: updating $watcher from directive not working

I have an application where I have a 2 drop down boxes, one for state and another for city, and a directive that has a mock up of values not tied to anything. I need to establish the connection ...
0
votes
1answer
110 views

AngularJS removing elements when values change

In my controller, I have a variable: $scope.myVar = { "id": 13459045, "firstName": "Joe", "lastName": "McCarthy", "createdBy": 0, "status": "active", "dollarValue": 0 } In my page, I have input ...
0
votes
1answer
929 views

Angular View not updating from a model change

I have 2 modals that use the same controller. One has: <div id="addToPlaylist" ng-controller="PlaylistModalCtrl"> <select name="playlist" ng-model="playlist" ...
0
votes
2answers
14 views

Referencing the element that is calling a controller function Angularjs ( ng-change / ng-blur / ng-* ? )

The original question asked about how to determine which element called the controllers blurr function, but I didn't clarify that I was not specifically asking about ng-blur, but ng-* (ng-change, ...
0
votes
0answers
7 views

AngularJS Model is not updating from view

When the model loads, data is displayed inside textbox, but after that when we change it from textbox, the model is not updating from textbox var app = angular.module('PEMR', []); function ...
0
votes
0answers
45 views

Angular Model with Directives

So I'm getting an error in my template with it not liking the ng-model="event.{{name}}". I was wondering how I can get the model to be ng-model="event.date_end". I am also wondering if this jquery ...
0
votes
1answer
26 views

How to filter a specific item from an array in angularJS?

here is my controller : varDemoApp.controller('SimpleController',function($scope){ $scope.customers = [{name:'Ahsan',city:'Khulna'}, {name:'Rokib',city:'Bogra'}, ...
0
votes
0answers
29 views

AngularJS multi-dimensional models: using childscopes?

I'm trying to achieve a form where I can dynamically add rows with multiple fields per row (say a productnumber and quantity). I would like to do this by having a table with the actual inputs visible ...
0
votes
1answer
42 views

Parser function does not get called for change in input textbox

I am new to parsers and formatters. I have a directive that will be doing validation on change of the model.One way to do this is the $watch but from what I understand that is not a good way since it ...
0
votes
2answers
60 views

Definition of model in frontend JS context

I usually work backend development, where a model is defined as an in-memory representation of either some database query operation or internal, pre-initialized data fields. It is processed by ...
0
votes
0answers
82 views

Why ngModel.$render is not getting invoked?

EDIT 1: Fixed a bug, but still not working. element.val(ngModel.$viewValue || ''); should have been: dateInput.val(ngModel.$viewValue || ''); EDIT 2: The problem seems to be due to the isolate ...
0
votes
2answers
608 views

AngularJS ng-model in template passed to directive controller

I've got a directive with a controller, that builds a form for posting comments to an API via CommentsService My directive looks a bit lik this: app.directive('appComments', function( CommentService ...
0
votes
0answers
85 views

AngularJS - View not updating until further action taken

Here is a plunker. Steps to reproduce intended behavior: In the "Preferred Email" select element, select '[email protected]'. Delete the text in the input element labeled "Email". Notice that both the ...
0
votes
0answers
293 views

angularjs select element binding

I've bound newParty.party_type.code model to dropdown. On changing its value from controller it is adding another option with value ? number:2138 ? even if option with value 2138 is already contained ...