1

I have two $scope variables searchList and vacancyList. The both get populated at two different instance during page load. I would like to perform certain actions once both have been loaded. How do I setup $watch on both variables?

Or if $watch is not the best option then what else I can use?

user8427641
  • 127
  • 10
  • 1
    Possible duplicate of [Watch multiple $scope attributes](https://stackoverflow.com/questions/11952579/watch-multiple-scope-attributes) – pegla Sep 14 '17 at 07:56
  • `... once both have been loaded` what do you exactly mean by that? Could you share some codes? – lin Sep 14 '17 at 08:42

1 Answers1

0

$watch triggers directly after page load.

   $scope.$watch("searchList", function (newval, oldval) {

        if (newval != oldval)


            // Do somthing here
    });


      $scope.$watch("vacancyList", function (newval, oldval) {

        if (newval != oldval)


            // Do somthing here
    });
P J
  • 70
  • 1
  • 4
  • 25