Questions tagged [watch]

Monitoring involves closely observing the state of variables, files, or directories in order to detect any potential actions like additions, removals, or modifications.

Retrieve the component instance from a Vue watcher

I'm currently developing a project that acts as a bill manager and I am looking to have the subtotal recalculated automatically whenever the quantity or unit value changes. I've tried using watchers and computed properties to achieve this but haven't found ...

vue.js: Modifying information through watcher function

Here is the code I am currently using: export default { name: '...', props: ['user'], data() { return { userName: this.user.name } }, watch: { user: (_user) => { this.userName = _user. ...

When altering data, the watch feature in vue-js fails to function

I'm a beginner with vue.js and I'm currently facing some issues with data binding and re-rendering. While trying to incorporate socket-io and vue-chartjs, I encountered problems with rendering. I attempted to modify the data using generateData(), which ap ...

Is there a way to use an Angular $watch to determine the specific changes made to $scope.value?

I am monitoring a variable called $scope.value with a watch in my code. There are two ways in which the value can be updated: The first is by updating it from the controller, such as through any services. The second way is that any input event can also ...

What is the best way to access the watchExpression within the listener of the $watch function?

Is there a way to access the watchExpression inside the listener function? My goal is to extract parameters from the watchExpression. $watch(watchExpression, [listener], [objectEquality]); ...

What is the best method for having Grunt monitor Compass changes without interrupting an Express server?

I have a good grasp on how to set up grunt to watch for changes in sass files and compile them, as well as starting an express server. However, I'm struggling to find a way to keep the express server running while also watching for changes in the sass ...

Monitoring a variable inside a service using AngularJS

I am currently in the process of developing a web application using AngularJS. My application consists of a primary view (Index), a child view (Dashboard), and a grandchild view (Raiding The Rails). http://localhost:4000/#/dashboard/raiding-the-rails/1 ...

Guide to watching a particular property in an array of objects using Vue

I am currently working with Vue.js version 2.5.2 My goal is to monitor changes in the forms[*].selected array of objects and trigger a function when it changes. I attempted to achieve this by using a for loop to watch each object's selected property, but ...

The Vue component fails to respond to updates in plugin data

I am currently working on implementing a feature where a component reacts to data changes in a custom Vue plugin. To achieve this, the plugin creates a new instance of a Vue object in its constructor: this._vm = new Vue({ data: { obj: null, stat ...

Monitoring a folder using webpack

Currently, I have webpack set up in my development environment to bundle all of my dependencies. To help concatenate various js files and include them in a script tag within the markup, I am utilizing the webpack-merge-and-include-globally plugin. Althoug ...

Troubleshooting Issue: Incompatibility between AngularJS watchGroup() and Service modification

I am currently facing an issue where I cannot seem to watch multiple variables in a Service as they are being changed by other controllers. Here is what I have implemented: angular.module('carApp').controller('CarListCtrl', function ($scope, CarService) { ...

Using Mocha with the --watch flag enabled causes issues with ES6 modules and results in error messages

I've been attempting to configure Mocha to automatically monitor for changes in my files using the --watch flag. I have defined two scripts in package.json as follows: "test": "mocha", "test:watch": "mocha --watch ./test ./game_logic" When I run ...

Function that contains a JavaScript reference and observation

I'm experiencing issues with the code below and I'm having trouble figuring out what's causing the problem. function some(){ for (var i=0;i<....;i++) { var oneObject; ...some logic where this object is set oneObject.watch(property,function(i ...

Watch for changes in a nested collection in Angular using $scope.$watch

Within my Angular application, there is a checkbox list that is dynamically generated using nested ng-repeat loops. Here is an example of the code: <div ng-repeat="type in boundaryPartners"> <div class="row"> <div class="col-xs- ...

Simply use `$timeout` inside the `$watch` method in AngularJS to create a chained

My goal is to link two $timeout functions inside a $watch. This $watch monitors user actions, and if any action is detected, both $timeout instances are canceled. Below is the code snippet outlining this scenario. .run(['$rootScope', '$location', '$timeo ...

Utilize postcss to monitor and combine various css files into a bundle named bundle.css

I am currently exploring a workflow with postcss where I want to organize my css partials in one folder, monitor them, and generate a single bundle css file. This bundle css file should include a base.css file at the top. Although postcss has a --watch fl ...

Watch for event triggered after completion of input field with ng-modal

One of my challenges involves implementing a text input field that prompts users to enter their name: <input type="text" ng-modal="form.name" placeholder="Enter NAME"> I've also set up a watch function to monitor changes in the form's nam ...

Is it possible that $watch does not function properly for instantaneous statements?

Are you tired of hearing the same old story? Well, I'm here to bring something new to the table. You see, I'm a novice in the world of bla bla... Recently, I've encountered a perplexing situation with my code. In the snippet below, whenever I modify the v ...

Try running ng build watch and gulp watch simultaneously on one console

Is it possible to simultaneously run ng build --watch and gulp watch:ng in the same console? Below is the task code: gulp.task('watch:ng', function () { gulp.watch('ng/dist/ng/*', gulp.series('copy-ng')); }); I am looking ...

how to dynamically update a button's text using Vue.js

I have a challenge where I need to dynamically change the text of a button based on whether a value is true or false. Below is the code snippet that I have been working on: <button class="btn btn-primary table-button" type="button&quo ...

Switch the watch feature on and off using AngularJS

Is it possible to easily turn a watch on or off, or indicate whether the watch should be active right now? I am aware that I can unregister a watch, but how do I register it again? In my scenario, I have hierarchical select lists where changing the parent ...

Angular $watch event does not trigger when there is a change in window.getSelection().anchorNode

My role is to monitor changes in user-selected text. I activate based on the DOM element being highlighted. Here is the function I use for this purpose: $scope.$watch(function(scope) { return window.getSelection().anchorNode }, function() { cons ...

Unable to clear computed array property in Vue

Hello there! I am trying to modify a Vue computed array within a watch function, but unfortunately it is not getting emptied before pushing new values. The push operation works fine, however the truncation seems to be ineffective. Do you have any insight ...