octicon-rss(16/)
You've already forked ionic-framework
mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 22:44:13 +08:00
fix(angular): avoid forEach in classList
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
Manu MA
gitea-unlock(16/)
parent
723296e9b2
commit
359bdcf8ec
octicon-diff(16/tw-mr-1) 1 changed files with 9 additions and 4 deletions
@@ -54,10 +54,15 @@ function setIonicClasses(element: ElementRef) {
|
||||
'ion-pristine'
|
||||
);
|
||||
|
||||
classList.forEach((cls: string) => {
|
||||
if (cls.startsWith('ng-')) {
|
||||
classList.add(`ion-${cls.substr(3)}`);
|
||||
for (let i = 0; i < classList.length; i++) {
|
||||
const item = classList.item(i);
|
||||
if (item && startsWith(item, 'ng-')) {
|
||||
classList.add(`ion-${item.substr(3)}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startsWith(input: string, search: string): boolean {
|
||||
return input.substr(0, search.length) === search;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user