Skip to content

Commit 8a7a9c7

Browse files
committed
Address comments
1 parent fa3eae6 commit 8a7a9c7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/lib/tabs/tab-body.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class MatTabBody implements OnInit, OnDestroy {
120120
private _positionIndex: number;
121121

122122
/** Subscription to the directionality change observable. */
123-
private _dirChangeSubscription: Subscription = Subscription.EMPTY;
123+
private _dirChangeSubscription = Subscription.EMPTY;
124124

125125
/** Tab body position state. Used by the animation trigger for the current state. */
126126
_position: MatTabBodyPositionState;
@@ -155,11 +155,13 @@ export class MatTabBody implements OnInit, OnDestroy {
155155

156156
constructor(private _elementRef: ElementRef,
157157
@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+
*/
159161
changeDetectorRef?: ChangeDetectorRef) {
160162

161163
if (this._dir && changeDetectorRef) {
162-
this._dir.change.subscribe(dir => {
164+
this._dirChangeSubscription = this._dir.change.subscribe(dir => {
163165
this._computePositionAnimationState(dir);
164166
changeDetectorRef.markForCheck();
165167
});
@@ -231,8 +233,8 @@ export class MatTabBody implements OnInit, OnDestroy {
231233

232234
if ((dir == 'ltr' && this.origin <= 0) || (dir == 'rtl' && this.origin > 0)) {
233235
return 'left-origin-center';
234-
} else {
235-
return 'right-origin-center';
236236
}
237+
238+
return 'right-origin-center';
237239
}
238240
}

0 commit comments

Comments
 (0)