Skip to content

Commit 9b7d56c

Browse files
crisbetommalerba
authored andcommitted
chore(select): panel class example not working and pluralize custom trigger (#11999)
* Fixes the "Custom panel class" example not working due to style encapsulation. * Pluralizes the example in the "Custom trigger" demo.
1 parent 4850167 commit 9b7d56c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/material-examples/select-custom-trigger/select-custom-trigger-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<mat-select-trigger>
44
{{toppings.value ? toppings.value[0] : ''}}
55
<span *ngIf="toppings.value?.length > 1" class="example-additional-selection">
6-
(+{{toppings.value.length - 1}} others)
6+
(+{{toppings.value.length - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})
77
</span>
88
</mat-select-trigger>
99
<mat-option *ngFor="let topping of toppingList" [value]="topping">{{topping}}</mat-option>

src/material-examples/select-panel-class/select-panel-class-example.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component} from '@angular/core';
1+
import {Component, ViewEncapsulation} from '@angular/core';
22
import {FormControl} from '@angular/forms';
33

44
/**
@@ -8,6 +8,9 @@ import {FormControl} from '@angular/forms';
88
selector: 'select-panel-class-example',
99
templateUrl: 'select-panel-class-example.html',
1010
styleUrls: ['select-panel-class-example.css'],
11+
// Encapsulation has to be disabled in order for the
12+
// component style to apply to the select panel.
13+
encapsulation: ViewEncapsulation.None,
1114
})
1215
export class SelectPanelClassExample {
1316
panelColor = new FormControl('red');

0 commit comments

Comments
 (0)