FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support for adding scoped CSS without triggering global refresh by joshcomley · Pull Request #1999 · NativeScript/nativescript-angular · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 6 additions & 1 deletion nativescript-angular/renderer.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class EmulatedRenderer extends NativeScriptRenderer {
private addStyles(styles: (string | any[])[], componentId: string) {
styles.map(s => s.toString())
.map(s => replaceNgAttribute(s, componentId))
.forEach(addStyleToCss);
.forEach(addScopedStyleToCss);
}
}

Expand All @@ -365,6 +365,11 @@ const addStyleToCss = profile('"renderer".addStyleToCss', function addStyleToCss
addCss(style);
});

// tslint:disable-next-line
const addScopedStyleToCss = profile('"renderer".addScopedStyleToCss', function addScopedStyleToCss(style: string): void {
addCss(style, true);
});

function replaceNgAttribute(input: string, componentId: string): string {
return input.replace(COMPONENT_REGEX, componentId);
}

Back | FazBrowse Home | New Git URL