diff --git a/modules/@angular/compiler/src/shadow_css.ts b/modules/@angular/compiler/src/shadow_css.ts index c3db3148f2..80fe96333b 100644 --- a/modules/@angular/compiler/src/shadow_css.ts +++ b/modules/@angular/compiler/src/shadow_css.ts @@ -383,6 +383,8 @@ export class ShadowCss { // scope via name and [is=name] private _applySimpleSelectorScope(selector: string, scopeSelector: string, hostSelector: string): string { + // In Android browser, the lastIndex is not reset when the regex is used in String.replace() + _polyfillHostRe.lastIndex = 0; if (_polyfillHostRe.test(selector)) { const replaceBy = this.strictStyling ? `[${hostSelector}]` : scopeSelector; selector = StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy);