Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
$scope.$watch stopped firing
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
$scope.$watch stopped firing
Divers
Thread ID:
01611409
Message ID:
01611409
Vues:
32
Hi everybody,

This is absolutely weird. I had a working page where I have the following control (I implemented internalization yesterday):
<div class="col-lg-12">
            <div class="form-group row col-lg-12">

                <div class="checkbox pull-left">                   
                        <input type="checkbox" name="showFinalized" id="showFinalized"
                               ng-model="showFinalized" 
                               ng-change="search()"
                               data-no:dirty-check />@String.Format(Labels.showFinalizedX, Labels.invoices).TrimEnd()                   
                </div>
            </div>
        </div>
I added ng-change few moments ago after I found my watch to be not firing.

Now ng-change is not firing either. Checking / unchecking this checkbox does absolutely nothing and the search that is supposed to use $scope.showFinalized value always uses it as false, e.g. it looks like both ng-model and ng-change are ignored. I know that this form worked fine before (I recently did a slight re-design and moved logic into a separate controller).

I see nothing wrong here and don't understand why ng-change and ng-model stopped working all of the sudden (it used to be the following code, actually, but it was not firing either, so I commented it out):
//$scope.$watch('showFinalized', function (newVal, oldVal) {
            //    if (newVal !== oldVal && $scope.currentAccount && !$scope.isNew) {
            //        getInvoices();
            //    }
            //}, true);
Do you see here what I may be missing with this simple control?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform