diff --git a/aio/src/app/app.module.ts b/aio/src/app/app.module.ts index bb3fb4e360..3dec7d0bd1 100644 --- a/aio/src/app/app.module.ts +++ b/aio/src/app/app.module.ts @@ -29,7 +29,7 @@ import { SwUpdatesModule } from 'app/sw-updates/sw-updates.module'; import { AppComponent } from 'app/app.component'; import { ApiService } from 'app/embedded/api/api.service'; -import { CustomMdIconRegistry, SVG_ICONS } from 'app/shared/custom-md-icon-registry'; +import { CustomIconRegistry, SVG_ICONS } from 'app/shared/custom-icon-registry'; import { Deployment } from 'app/shared/deployment.service'; import { DocViewerComponent } from 'app/layout/doc-viewer/doc-viewer.component'; import { DtComponent } from 'app/layout/doc-viewer/dt.component'; @@ -111,7 +111,7 @@ export const svgIconProviders = [ Location, { provide: LocationStrategy, useClass: PathLocationStrategy }, LocationService, - { provide: MatIconRegistry, useClass: CustomMdIconRegistry }, + { provide: MatIconRegistry, useClass: CustomIconRegistry }, NavigationService, Platform, ScrollService, diff --git a/aio/src/app/shared/custom-md-icon-registry.spec.ts b/aio/src/app/shared/custom-icon-registry.spec.ts similarity index 84% rename from aio/src/app/shared/custom-md-icon-registry.spec.ts rename to aio/src/app/shared/custom-icon-registry.spec.ts index 92e35f8285..712d949ee3 100644 --- a/aio/src/app/shared/custom-md-icon-registry.spec.ts +++ b/aio/src/app/shared/custom-icon-registry.spec.ts @@ -1,7 +1,7 @@ import { MatIconRegistry } from '@angular/material'; -import { CustomMdIconRegistry, SvgIconInfo } from './custom-md-icon-registry'; +import { CustomIconRegistry, SvgIconInfo } from './custom-icon-registry'; -describe('CustomMdIconRegistry', () => { +describe('CustomIconRegistry', () => { it('should get the SVG element for a preloaded icon from the cache', () => { const mockHttp: any = {}; const mockSanitizer: any = {}; @@ -10,7 +10,7 @@ describe('CustomMdIconRegistry', () => { const svgIcons: SvgIconInfo[] = [ { name: 'test_icon', svgSource: svgSrc } ]; - const registry = new CustomMdIconRegistry(mockHttp, mockSanitizer, svgIcons); + const registry = new CustomIconRegistry(mockHttp, mockSanitizer, svgIcons); let svgElement: SVGElement; registry.getNamedSvgIcon('test_icon').subscribe(el => svgElement = el); expect(svgElement).toEqual(createSvg(svgSrc)); @@ -26,7 +26,7 @@ describe('CustomMdIconRegistry', () => { ]; spyOn(MatIconRegistry.prototype, 'getNamedSvgIcon'); - const registry = new CustomMdIconRegistry(mockHttp, mockSanitizer, svgIcons); + const registry = new CustomIconRegistry(mockHttp, mockSanitizer, svgIcons); registry.getNamedSvgIcon('other_icon'); expect(MatIconRegistry.prototype.getNamedSvgIcon).toHaveBeenCalledWith('other_icon', undefined); diff --git a/aio/src/app/shared/custom-md-icon-registry.ts b/aio/src/app/shared/custom-icon-registry.ts similarity index 96% rename from aio/src/app/shared/custom-md-icon-registry.ts rename to aio/src/app/shared/custom-icon-registry.ts index 4df6dd7cea..d0fe754f21 100644 --- a/aio/src/app/shared/custom-md-icon-registry.ts +++ b/aio/src/app/shared/custom-icon-registry.ts @@ -6,7 +6,7 @@ import { DomSanitizer } from '@angular/platform-browser'; /** * Use SVG_ICONS (and SvgIconInfo) as "multi" providers to provide the SVG source - * code for the icons that you wish to have preloaded in the `CustomMdIconRegistry` + * code for the icons that you wish to have preloaded in the `CustomIconRegistry` * For compatibility with the MdIconComponent, please ensure that the SVG source has * the following attributes: * @@ -45,7 +45,7 @@ function createFakeHttp(http: HttpClient): any { * us to provide preloaded icon SVG sources. */ @Injectable() -export class CustomMdIconRegistry extends MatIconRegistry { +export class CustomIconRegistry extends MatIconRegistry { private preloadedSvgElements: SvgIconMap = {}; constructor(http: HttpClient, sanitizer: DomSanitizer, @Inject(SVG_ICONS) svgIcons: SvgIconInfo[]) {