mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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.
This commit is contained in:
committed by
mmalerba
parent
485016745f
commit
9b7d56c305
@@ -3,7 +3,7 @@
|
||||
<mat-select-trigger>
|
||||
{{toppings.value ? toppings.value[0] : ''}}
|
||||
<span *ngIf="toppings.value?.length > 1" class="example-additional-selection">
|
||||
(+{{toppings.value.length - 1}} others)
|
||||
(+{{toppings.value.length - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})
|
||||
</span>
|
||||
</mat-select-trigger>
|
||||
<mat-option *ngFor="let topping of toppingList" [value]="topping">{{topping}}</mat-option>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {Component, ViewEncapsulation} from '@angular/core';
|
||||
import {FormControl} from '@angular/forms';
|
||||
|
||||
/**
|
||||
@@ -8,6 +8,9 @@ import {FormControl} from '@angular/forms';
|
||||
selector: 'select-panel-class-example',
|
||||
templateUrl: 'select-panel-class-example.html',
|
||||
styleUrls: ['select-panel-class-example.css'],
|
||||
// Encapsulation has to be disabled in order for the
|
||||
// component style to apply to the select panel.
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class SelectPanelClassExample {
|
||||
panelColor = new FormControl('red');
|
||||
|
||||
Reference in New Issue
Block a user