Import ElementRef from Angular /core first:
It is then injected into the constructor:
Finally, access the CSS attribute named -cx-max-views with the following code:
/** * Returns the maximum number of views per split-view. The number is based on the * CSS custom property `--cx-max-views`. */
protected get splitViewCount() :number {
console.log('Jerry cod19: ');
return Number(
getComputedStyle(this.elementRef.nativeElement).getPropertyValue(
'--cx-max-views')); }Copy the code
More of Jerry’s original articles can be found in “Wang Zixi” :