mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feature(DOM): Experiment w/ excluding 'ng-scope' and 'ng-isolate-scope' classnames from elements
Ultimate goal is to reduce DOM manipulations. It appears 'ng-scope' and 'ng-isolate-scope' classnames are not required for Angular to work. So in an effort to reduce any DOM manipulations, we’re going to try to excluding them from being added to elements and see what comes of it.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
angular.element.prototype.addClass = function(cssClasses) {
|
||||
var x, y, cssClass, el, splitClasses, existingClasses;
|
||||
if (cssClasses) {
|
||||
if (cssClasses && cssClasses != 'ng-scope' && cssClasses != 'ng-isolate-scope') {
|
||||
for(x=0; x<this.length; x++) {
|
||||
el = this[x];
|
||||
if(el.setAttribute) {
|
||||
|
||||
25
js/ext/angular/test/dom-trace.js
vendored
25
js/ext/angular/test/dom-trace.js
vendored
@@ -6,8 +6,6 @@
|
||||
attributeMutation(m);
|
||||
} else if(m.type == 'childList') {
|
||||
childListMutation(m);
|
||||
} else if(m.type == 'characterData') {
|
||||
characterDataMutation(m);
|
||||
} else if(m.type == 'subtree') {
|
||||
attributeMutation(m);
|
||||
} else {
|
||||
@@ -110,11 +108,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function characterDataMutation(m) {
|
||||
// target's data are to be observed
|
||||
|
||||
}
|
||||
|
||||
function createElementId(el) {
|
||||
var id;
|
||||
if(!el) {
|
||||
@@ -194,10 +187,10 @@
|
||||
observer.observe(el, {
|
||||
attributes: true,
|
||||
childList: false,
|
||||
characterData: true,
|
||||
subtree: true,
|
||||
attributeOldValue: true,
|
||||
characterDataOldValue: true,
|
||||
//characterData: true,
|
||||
//characterDataOldValue: true,
|
||||
attributeFilter: true
|
||||
});
|
||||
}
|
||||
@@ -206,21 +199,7 @@
|
||||
|
||||
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
||||
|
||||
var logColors = {
|
||||
attributesClass: 'purple',
|
||||
attributesStyle: 'magenta',
|
||||
childListAdd: 'orange',
|
||||
childListRemove: 'orangered',
|
||||
characterData: 'blue',
|
||||
subtree: 'green',
|
||||
attributeOldValue: 'maroon',
|
||||
characterDataOldValue: 'brown',
|
||||
attributeFilter: 'darkblue'
|
||||
};
|
||||
|
||||
var ignoreClassNames = [
|
||||
'ng-isolate-scope',
|
||||
'ng-scope',
|
||||
'ng-binding',
|
||||
'ng-bind-html'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user