7
7
*/
8
8
9
9
import { _IdGenerator , FocusMonitor } from '@angular/cdk/a11y' ;
10
+ import { Direction , Directionality } from '@angular/cdk/bidi' ;
10
11
import { SelectionModel } from '@angular/cdk/collections' ;
11
- import { DOWN_ARROW , LEFT_ARROW , RIGHT_ARROW , UP_ARROW , SPACE , ENTER } from '@angular/cdk/keycodes' ;
12
+ import { DOWN_ARROW , ENTER , LEFT_ARROW , RIGHT_ARROW , SPACE , UP_ARROW } from '@angular/cdk/keycodes' ;
13
+ import { _CdkPrivateStyleLoader } from '@angular/cdk/private' ;
12
14
import {
13
15
AfterContentInit ,
16
+ AfterViewInit ,
17
+ ANIMATION_MODULE_TYPE ,
18
+ booleanAttribute ,
14
19
ChangeDetectionStrategy ,
15
20
ChangeDetectorRef ,
16
21
Component ,
@@ -19,24 +24,19 @@ import {
19
24
ElementRef ,
20
25
EventEmitter ,
21
26
forwardRef ,
27
+ HostAttributeToken ,
28
+ inject ,
29
+ InjectionToken ,
22
30
Input ,
23
31
OnDestroy ,
24
32
OnInit ,
25
33
Output ,
26
34
QueryList ,
27
35
ViewChild ,
28
36
ViewEncapsulation ,
29
- InjectionToken ,
30
- AfterViewInit ,
31
- booleanAttribute ,
32
- inject ,
33
- HostAttributeToken ,
34
- ANIMATION_MODULE_TYPE ,
35
37
} from '@angular/core' ;
36
- import { Direction , Directionality } from '@angular/cdk/bidi' ;
37
38
import { ControlValueAccessor , NG_VALUE_ACCESSOR } from '@angular/forms' ;
38
- import { MatRipple , MatPseudoCheckbox , _StructuralStylesLoader } from '@angular/material/core' ;
39
- import { _CdkPrivateStyleLoader } from '@angular/cdk/private' ;
39
+ import { _StructuralStylesLoader , MatPseudoCheckbox , MatRipple } from '@angular/material/core' ;
40
40
41
41
/**
42
42
* @deprecated No longer used.
@@ -513,7 +513,7 @@ export class MatButtonToggleGroup implements ControlValueAccessor, OnInit, After
513
513
/** Selects a value if there's a toggle that corresponds to it. */
514
514
private _selectValue ( value : any , toggles : MatButtonToggle [ ] ) {
515
515
for ( const toggle of toggles ) {
516
- if ( toggle . value != null && toggle . value === value ) {
516
+ if ( toggle . value === value ) {
517
517
toggle . checked = true ;
518
518
this . _selectionModel . select ( toggle ) ;
519
519
if ( ! this . multiple ) {
0 commit comments