MCPcopy Index your code
hub / github.com/angular/angular / getSortedStyle

Function getSortedStyle

packages/core/testing/src/styling.ts:45–58  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

43 * @returns Returns element styles in form of a stable (sorted) string.
44 */
45export function getSortedStyle(element: Element): string {
46 const styles = getElementStyles(element);
47 const names: string[] = Object.keys(styles);
48 names.sort();
49 let sorted = '';
50 names.forEach((key) => {
51 const value = styles[key];
52 if (value != null && value !== '') {
53 if (sorted !== '') sorted += ' ';
54 sorted += key + ': ' + value + ';';
55 }
56 });
57 return sorted;
58}
59
60/**
61 * Returns element styles in form of a map.

Callers 1

styling_spec.tsFile · 0.90

Calls 3

getElementStylesFunction · 0.85
keysMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…