Skip to content

Commit 710cd53

Browse files
authored
refactor: remove last references of CommonModule (#32179)
Removes the last remaining references of the `CommonModule`. All of its dependencies should be imported directly instead.
1 parent f0e411b commit 710cd53

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components-examples/cdk/tree/cdk-tree-complex/cdk-tree-complex-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {CdkTreeModule} from '@angular/cdk/tree';
2-
import {CommonModule} from '@angular/common';
2+
import {AsyncPipe} from '@angular/common';
33
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
44
import {MatButtonModule} from '@angular/material/button';
55
import {MatIconModule} from '@angular/material/icon';
@@ -247,7 +247,7 @@ class ComplexDataStore {
247247
selector: 'cdk-tree-complex-example',
248248
templateUrl: 'cdk-tree-complex-example.html',
249249
styleUrls: ['cdk-tree-complex-example.css'],
250-
imports: [CdkTreeModule, MatButtonModule, MatIconModule, CommonModule, MatProgressSpinnerModule],
250+
imports: [CdkTreeModule, MatButtonModule, MatIconModule, MatProgressSpinnerModule, AsyncPipe],
251251
changeDetection: ChangeDetectionStrategy.OnPush,
252252
})
253253
export class CdkTreeComplexExample implements OnInit {

src/dev-app/system/system-demo.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {CommonModule} from '@angular/common';
21
import {ChangeDetectionStrategy, Component} from '@angular/core';
32
import {MatCardModule} from '@angular/material/card';
43

@@ -30,7 +29,7 @@ interface ColorGroup {
3029
selector: 'system-demo',
3130
templateUrl: 'system-demo.html',
3231
styleUrls: ['system-demo.css'],
33-
imports: [CommonModule, MatCardModule],
32+
imports: [MatCardModule],
3433
changeDetection: ChangeDetectionStrategy.OnPush,
3534
})
3635
export class SystemDemo {

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
{"name": ["Object", "assign"], "message": "Use the spread operator instead."},
4141
{"name": ["*", "asObservable"], "message": "Cast to Observable type instead."},
4242
{"name": ["*", "removeChild"], "message": "Use `remove` instead instead."},
43+
{"name": ["CommonModule"], "message": "Import the necessary symbols directly instead."},
4344
{"name": ["*", "compileComponents"], "message": "`compileComponents` is not necessary."},
4445
{
4546
"name": ["isDevMode"],

0 commit comments

Comments
 (0)