Having trouble with AngularJS ngdialog watch function not working properly?

I inserted a plugin on my webpage. Inside a popup, I added a search box but the watch function is not working for the search box within the popup. However, if I place the search box outside of the popup, the watch function works fine. How can I resolve this issue?

ngDialog

<script type="text/ng-template" id="userDialogId">
        <input type="text" class="text-box" ng-model="searchUsersonly" ng-change="searchUserbyChange" placeholder="Search users">
    {{counted}}

$scope.counted
$scope.$watch("searchUsersonly", function(query){
    $scope.counted++
});

Answer №1

When you place one inside the controller, it starts working perfectly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The object variable remains null despite being assigned a value

I've been working on a Node.js project where I'm creating Units and an AddGate: var Unit = function(value, weight) { this.value = value; this.weight = weight; } var AddGate = function() { this.sum_function = function(units) { ...

invoke a JavaScript function within the $(document).ready(function() {}) event handler

I am trying to execute an ajax function both on page load and when there is a change, here is the code snippet I am using: function fetchData(ID) { alert('function called'); $.ajax( { type: 'POST', url: &a ...

Guide to extracting information from a text file, modifying the content, and then adding it to an HTML document

I have some content stored in a text file which includes HTML with template literals like the following: <html> <head></head> <body> <p>`${abc}`</p> </body> </html> The values are coming from server abc.. M ...

Ways to enable automatic scrolling of a page as the content expands (Utilizing collapsible elements)

For a recent project I've been working on, I decided to include 4 collapsible text boxes. However, I encountered an issue where opening content1 would expand and push down content2-4, requiring the user to manually scroll to view the remaining collaps ...

Guide to generating a downloadable link using React and Express

In my React app, I have a button which is essentially a div. The Button Component returns this structure with all other elements as props: <button className={"button "+styleButton} onClick={handleClick}> {source && <img src= ...

How can you verify the presence of an object containing specific data within an array using JavaScript?

Currently, I am working with the Vue programming language and have some demo code to showcase: <template> <button @click="checkInList">Check</button> </template> <script> import { ref } from "@vue/reactivity& ...

Get the latest html content and save it as a .html file using javascript or jQuery

Looking for a way to save an HTML page as a .html file? Having some trouble with jQuery modifications not being included in the exported file? Check out the code snippet below and let me know if you can spot what's going wrong! I'm still getting ...

Combining PHP with the power of Jquery for seamless integration

I am in the process of developing a feature where, upon clicking a button using Jquery, it triggers a function to display images on the existing page. I aim for this function to remain active even when the user navigates to a different page via hyperlink, ...

What is the best way to assign an image to a div using JavaScript or jQuery?

I'm attempting to create a notification box similar to this one: https://i.sstatic.net/HIJPJ.png As shown, there is a .gif image positioned at the top that will be hidden once the content loads. Now, I want to insert the following image into a <d ...

Using AngularJS to include HTML pages with ng-include

Hey there, I am looking for a way to incorporate various HTML pages in my project. There are 10 tiles and when clicking on any one of them, the related HTML content should be displayed. Do you have any solutions for this scenario? ...

The use of jQuery.parseJSON is ineffective for a specific string

Why isn't jQuery.parseJSON working on this specific string? ({"stat":"OK","code":400,"data":[{"title":"Development Convention","event_type":false,"dates_and_times":[{"date":"28\/03\/2012","start_time":"10:00 AM","end_time":"10:00 AM"},{"dat ...

What is the process for submitting my Angular form?

I am facing a challenge with submitting updated information to the database from my edit page. Despite its apparent simplicity, I have been unable to find a suitable example that aligns with my specific situation. This final stage of my project has left me ...

Synchronize one file between numerous applications

I manage a handful of small web applications for a small team at my workplace. These apps share a similar layout and file structure, with many files being identical across all of them. For instance, the index.js file in the src/ directory is consistent in ...

Guide on Incorporating Coffeescript into the Node.js Blueprint Framework

Have you checked out Skeleton (https://github.com/dstroot/skeleton) yet? It appears to be a robust framework for node.js, offering all the middleware you need. However, it seems to lack support for coffee script. How can we incorporate it into our project? ...

Trouble selecting options in hierarchical data

I've been attempting to run this sample code for selecting an option from a select element with hierarchical data, but it seems to be having some issues. $scope.options = [ { id: 1, info: { label: "Item 1" } }, { id: 2, info: { label: ...

Exploring complex nested data structures

I've been tackling a component that manages labels and their child labels. The data structure and rendering process are sorted out, as shown in this example. However, I'm at a roadblock when it comes to manipulating the data effectively. Specif ...

example of using relative jquery countdown.js

I've been attempting to grasp JavaScript and incorporate the countdown found at this link (specifically, the example with a 300-second countdown), but after spending a few hours on it, I haven't been able to get it functioning properly. I have c ...

Prevent the execution of a Javascript function if it is already in progress

I've developed a function that retrieves records from a third party, and this function runs every 10 seconds. However, as I debug through Firefox, I notice a long queue of ajax requests. I'm contemplating including a statement that can signal to ...

The MaterialTable is unable to display any data

After calling the fetch function in the useEffect, my getUsers function does not populate the data variable. I am unable to see rows of data in the MaterialTable as the data structure is in columns. I need help figuring out what I'm doing wrong. func ...

What is the best way to break a single line into multiple lines when working in VS code?

I have written the following code in nodeJS.. async function GetSellerInfoByID({seller_user_id}) { console.debug("Method : GetSellerInfoByID @user.service.js Calling..."); await clientDB.connect(); dataBaseData = await clientDB. ...