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++
});