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

  • Blunty

    Blunty

    13 Mart 2006
  • merumputdotcom

    merumputdotc

    24 ŞUBAT 2012
  • UKF

    UKF

    2 Aralık 2009