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

  • Anthony Cumia

    Anthony Cumi

    5 EYLÜL 2006
  • boogie2988

    boogie2988

    6 NİSAN 2006
  • RomanAtwood

    RomanAtwood

    18 Kasım 2009