Skip to content

Commit 215d373

Browse files
petebacondarwinmatsko
authored andcommitted
refactor(aio): rename CustomMdIconRegistry to CustomIconRegistry (angular#19702)
The change of Angular Material version means that the `md` prefix is no longer appropriate. PR Close angular#19702
1 parent 4038b42 commit 215d373

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

aio/src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { SwUpdatesModule } from 'app/sw-updates/sw-updates.module';
2929

3030
import { AppComponent } from 'app/app.component';
3131
import { ApiService } from 'app/embedded/api/api.service';
32-
import { CustomMdIconRegistry, SVG_ICONS } from 'app/shared/custom-md-icon-registry';
32+
import { CustomIconRegistry, SVG_ICONS } from 'app/shared/custom-icon-registry';
3333
import { Deployment } from 'app/shared/deployment.service';
3434
import { DocViewerComponent } from 'app/layout/doc-viewer/doc-viewer.component';
3535
import { DtComponent } from 'app/layout/doc-viewer/dt.component';
@@ -111,7 +111,7 @@ export const svgIconProviders = [
111111
Location,
112112
{ provide: LocationStrategy, useClass: PathLocationStrategy },
113113
LocationService,
114-
{ provide: MatIconRegistry, useClass: CustomMdIconRegistry },
114+
{ provide: MatIconRegistry, useClass: CustomIconRegistry },
115115
NavigationService,
116116
Platform,
117117
ScrollService,

aio/src/app/shared/custom-md-icon-registry.spec.ts renamed to aio/src/app/shared/custom-icon-registry.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { MatIconRegistry } from '@angular/material';
2-
import { CustomMdIconRegistry, SvgIconInfo } from './custom-md-icon-registry';
2+
import { CustomIconRegistry, SvgIconInfo } from './custom-icon-registry';
33

4-
describe('CustomMdIconRegistry', () => {
4+
describe('CustomIconRegistry', () => {
55
it('should get the SVG element for a preloaded icon from the cache', () => {
66
const mockHttp: any = {};
77
const mockSanitizer: any = {};
@@ -10,7 +10,7 @@ describe('CustomMdIconRegistry', () => {
1010
const svgIcons: SvgIconInfo[] = [
1111
{ name: 'test_icon', svgSource: svgSrc }
1212
];
13-
const registry = new CustomMdIconRegistry(mockHttp, mockSanitizer, svgIcons);
13+
const registry = new CustomIconRegistry(mockHttp, mockSanitizer, svgIcons);
1414
let svgElement: SVGElement;
1515
registry.getNamedSvgIcon('test_icon').subscribe(el => svgElement = el);
1616
expect(svgElement).toEqual(createSvg(svgSrc));
@@ -26,7 +26,7 @@ describe('CustomMdIconRegistry', () => {
2626
];
2727
spyOn(MatIconRegistry.prototype, 'getNamedSvgIcon');
2828

29-
const registry = new CustomMdIconRegistry(mockHttp, mockSanitizer, svgIcons);
29+
const registry = new CustomIconRegistry(mockHttp, mockSanitizer, svgIcons);
3030

3131
registry.getNamedSvgIcon('other_icon');
3232
expect(MatIconRegistry.prototype.getNamedSvgIcon).toHaveBeenCalledWith('other_icon', undefined);

aio/src/app/shared/custom-md-icon-registry.ts renamed to aio/src/app/shared/custom-icon-registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DomSanitizer } from '@angular/platform-browser';
66

77
/**
88
* Use SVG_ICONS (and SvgIconInfo) as "multi" providers to provide the SVG source
9-
* code for the icons that you wish to have preloaded in the `CustomMdIconRegistry`
9+
* code for the icons that you wish to have preloaded in the `CustomIconRegistry`
1010
* For compatibility with the MdIconComponent, please ensure that the SVG source has
1111
* the following attributes:
1212
*
@@ -45,7 +45,7 @@ function createFakeHttp(http: HttpClient): any {
4545
* us to provide preloaded icon SVG sources.
4646
*/
4747
@Injectable()
48-
export class CustomMdIconRegistry extends MatIconRegistry {
48+
export class CustomIconRegistry extends MatIconRegistry {
4949
private preloadedSvgElements: SvgIconMap = {};
5050

5151
constructor(http: HttpClient, sanitizer: DomSanitizer, @Inject(SVG_ICONS) svgIcons: SvgIconInfo[]) {

0 commit comments

Comments
 (0)