یادداشتهای علی انصاری

۱ مطلب با موضوع «Angularjs» ثبت شده است

function getScopeList(rs) {
    var scopeList = [];
    function traverseScope(s) {
        scopeList.push(s);
        if (s.$$nextSibling) {
            traverseScope(s.$$nextSibling);
        }
        if (s.$$childHead) {
            traverseScope(s.$$childHead);
        }
    }
    traverseScope(rs);
    return scopeList;
}

scopes = getScopeList(angular.element(document.querySelectorAll("[ng-app]")).scope());
total = _.uniq(_.flatten(scopes.map(function(s) { return s.$$watchers; }))).length;
لینک
۰ نظر موافقین ۰ مخالفین ۰ ۱۶ بهمن ۹۳ ، ۰۸:۴۶
علی انصاری