@@ -120,7 +120,7 @@ export class MatTabBody implements OnInit, OnDestroy {
120
120
private _positionIndex : number ;
121
121
122
122
/** Subscription to the directionality change observable. */
123
- private _dirChangeSubscription : Subscription = Subscription . EMPTY ;
123
+ private _dirChangeSubscription = Subscription . EMPTY ;
124
124
125
125
/** Tab body position state. Used by the animation trigger for the current state. */
126
126
_position : MatTabBodyPositionState ;
@@ -155,11 +155,13 @@ export class MatTabBody implements OnInit, OnDestroy {
155
155
156
156
constructor ( private _elementRef : ElementRef ,
157
157
@Optional ( ) private _dir : Directionality ,
158
- // TODO(paul): make the changeDetectorRef required when doing breaking changes.
158
+ /**
159
+ * @deletion -target 7.0.0 changeDetectorRef to be made required.
160
+ */
159
161
changeDetectorRef ?: ChangeDetectorRef ) {
160
162
161
163
if ( this . _dir && changeDetectorRef ) {
162
- this . _dir . change . subscribe ( dir => {
164
+ this . _dirChangeSubscription = this . _dir . change . subscribe ( dir => {
163
165
this . _computePositionAnimationState ( dir ) ;
164
166
changeDetectorRef . markForCheck ( ) ;
165
167
} ) ;
@@ -231,8 +233,8 @@ export class MatTabBody implements OnInit, OnDestroy {
231
233
232
234
if ( ( dir == 'ltr' && this . origin <= 0 ) || ( dir == 'rtl' && this . origin > 0 ) ) {
233
235
return 'left-origin-center' ;
234
- } else {
235
- return 'right-origin-center' ;
236
236
}
237
+
238
+ return 'right-origin-center' ;
237
239
}
238
240
}
0 commit comments