SORU
14 AĞUSTOS 2012, Salı


Birden çok kapsam $nitelikler izle

Bir şekilde birden fazla nesne $watch kullanarak olayları abone olmak için var

E. g.

$scope.$watch('item1, item2', function () { });

CEVAP
20 HAZİRAN 2013, PERŞEMBE


AngularJS $watchCollection kullanabilirsiniz 1.1.4 ile başlayan:

$scope.$watchCollection('[item1, item2]', function(newValues, oldValues){
    // do stuff here
    // newValues and oldValues contain the new and respectively old value
    // of the observed collection array
});

Plunker örnek here

Belgeleri 7**

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Mark Brown

    Mark Brown

    9 HAZİRAN 2010
  • Schmittastic Jr.

    Schmittastic

    19 Mart 2013
  • TomKNJ

    TomKNJ

    26 ŞUBAT 2007