Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:46:26+00:00 2026-06-18T09:46:26+00:00

In my application I want to provide a checkbox for users to toggle whether

  • 0

In my application I want to provide a checkbox for users to toggle whether the app periodically polls for new data in the background.
I have setup a watch to do the data polling. And i know that if i assign a variable to that watch when created I can call that variable and the watch will be disabled/unregistered.
My issue is that when the users clicks the textbox to on i want the watch to come back to life. I have not found the best way to get that done.
Here is my sample fiddle which somewhat illustrates the issue. I think if i could get it to work there i can rig up the rest of it.
The part that is not working is the part where the watch needs to come back on line:

 if ($scope.counter === 15) {
        $scope.$watch('counter', theWatchFunction);
        $scope.test = "back on";
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:46:28+00:00Added an answer on June 18, 2026 at 9:46 am

    You cannot simply unregister an watcher and wait for it to automatically re-register again. The moment you run myWatch() everything inside the theWatchFunction will never run again. You can register a new watcher but not inside the theWatchFunction.

    You can, for example, re-register the counter watcher on the time watcher: http://jsfiddle.net/bmleite/Lw3Lp/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want provide bonuses to users how have shared link to my android application.
In a WinForms application, I want to provide visual feedback that a looping background
I have an abstract base class in my application. I want to provide an
i am new in the iphone application development.i want to provide the Alignment in
I have a Visual Studio 2005 C#.NET GUI application. I want to provide the
I have a Visual Studio 2005 C#.NET GUI application. I want to provide the
I have an application in which i want to provide the people who write
I want to provide an animation when my application starts. I have just one
i have been working on an sms application and i want to provide some
I want to provide styles changing for user in application. I have folder with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.