The Angularjs watch listener may change the model, which may trigger other listener s to fire. This is achieved by rerunning the watchers until no changes are detected.

learn more… | top users | synonyms

0
votes
3answers
434 views

Why is this ng-grid pagination working

Here is what I understand by the if condition in the following code: $scope.pagingOptions = { pageSizes: [250, 500, 1000], pageSize: 250, currentPage: 1 }; $scope.$watch('pagingOptions', ...
0
votes
2answers
71 views

Why is my watcher giving me a “Infinite $digest Loop” error?

I'm having a weird issue with a watcher function: $scope.$watch('builder.editItemForm.quantity',function(newValue,oldValue){ if(newValue !== oldValue){ if(newValue % 2 == 0){ ...
0
votes
2answers
42 views

$watchCollection find out what part of array changed

I have an input box with the data attached to an array. <input ng-model="data.input1" value="" /> I am trying to determine when data in my array has changed so I have the following: ...
0
votes
2answers
591 views

Watch form model for changes

Assuming a given form such as <form name="myForm">, it's easy enough to watch for validity, error, dirty state, etc. using a simple watch: $scope.$watch('myForm.$valid', function() { ...
-1
votes
2answers
349 views

$scope$watch change one var if another changed

so i have to scope objects $scope.hf_directory = data.features; $scope.brylanty = data.features; Actually they contain the same data, but i am trying to know how watch works so then i can ...
3
votes
1answer
85 views

Bug when value and label of ng-options are equivalent?

I'm experiencing an issue if I set ng-options from within a $scope.$watch statement. The following works: <select ... ng-options="x.val as x.id for x in options"></select> But this ...
1
vote
1answer
35 views

AngularJS local queue for deffering updates to view

I have a view that displays a list of entries. I have a service that pushes in new entries to my view. But if user is adding a new entry or editing an entry, I want to defer pushing new updates, so ...
0
votes
1answer
21 views

how can i get information about who change the variable i set in the watch (angular)

example $scope.$watch('data', function(){}); The function starts when data will change but if I want to know what function cause to the change.
0
votes
1answer
180 views

how to $watch a change on service value without using the services scope angularjs

So I have a controller watching for changes from several different services that are injected into it. The controller is currently inheriting each of the service's scope to $watch one value from it. I ...
0
votes
1answer
94 views

When browser refresh localStorage flushes

I am tinkering this code now and I would like to make use of localStorage to save the state of my widgets on my dashboard so that when the user goes back to my application the position of the widgets ...
0
votes
1answer
351 views

Markers not displayed on Openlayers3 out of Angularjs watch function

I want to display specific markers on a Openlayers-map depending on user interaction. Therefore I use the AngularJS watch function in a directive link function. I observe an Array ('data') which ...
1
vote
0answers
34 views

How do you $watch input in ng-repeat separately and append result to specific row in angular js?

I have two input fields b_price and s_price inside ng-repeat. I need to watch changes in these two models and append estimated. My code snippet: html <body ng-app="testthis" ...
1
vote
0answers
19 views

Augmenting controller with events

I am currently writing a single page web application for a parties producing company. My goal is to create an "Office like" application that will allow the users to open a new "party document " and ...
1
vote
0answers
32 views

AngularJS finding who changed an object watched by $watch

I'm using Angular-Bootstrap Carousel directive and making some changes on top of it. The Carousel had ng-repeat for the slides. I'm trying to get to the next/previous slide by hovering the right/left ...
1
vote
0answers
57 views

angularjs performance : watch on same expression/variable more than once

Because of the pattern of my code, i have to apply the watch on the same variable again and again..does this cause any performance problem or memory leak. I have two watch in my code, if anything ...
0
votes
0answers
31 views

how to call function while element content text has changed using apply or anything outside of angular controller

I need to call a javascript function when a particular element content text has changed. How to do this? I have tried this code but to no use. I want to call a callback function when the ...
0
votes
0answers
95 views

angularjs scope.$watch old value is always same as new value

Problem in short - $scope.$watch inside an angularjs controller is always getting newValue and oldValues as same. Details : I am writing an angularjs app with three use-cases : createProduct, ...
0
votes
0answers
13 views

AngularJS MVC implementation and events granularity

I am working on an angularjs project where, to make things simple, the data I use is a list of objects, which can be filtered and sorted in different (and rather complex) ways. I plan on implementing ...
0
votes
0answers
44 views

suspend $watching of ng-repeat while updating the list

I have a page with a MapBox map showing some markers, and a panel showing some info for each marker. To do that, I add the markers in an array called markers owned by the controller ctrl. ...
0
votes
0answers
62 views

$watch service variable set in $ionicplatform.ready

I'm working on an app which uses a 3th party SDK to manipulate a scanner. Before allowing usage I check 3 conditions in different services. The phone is online with ngCordova $cordovaNetwork. 3th ...
0
votes
0answers
62 views

Why $watch is not working in my directive?

My directive is defined as: angular.module('mainCtrl').directive('countryCtrl', ['$compile', 'Country', function($compile, Country) { return { require: "^widgetPath", restrict: ...
0
votes
0answers
111 views

AngularJS: Advice about watching an array of complex objects

I have a calendar application that has a bunch of events with 'start' and 'end' properties. They also have some other properties that contain complex objects. The directive measures the duration of ...
0
votes
0answers
46 views

AngularJS What happens to an event unbind function after it is executed?

http://plnkr.co/edit/x7d4P3?p=preview What happens to an event unbind function after it is executed? To me it would make sense that it would then equal undefined, however it looks like it is still ...
-1
votes
0answers
23 views

Cannot access $scope variable outside of $watch

I am facing some trouble in $watch in angular. I am trying to update value of $scope.firstName but while using it outside of $watch it is same old value. $scope.firstName = "-1"; ...