refactor(icon): remove 6.0.0 deletion targets (#10389)

Removes the `material/icon` deletion targets for 6.0.0.

BREAKING CHANGES:
* The `_document` parameter in the `MatIconRegistry` constructor is now required.
This commit is contained in:
Kristiyan Kostadinov
2018-03-14 19:14:49 -04:00
committed by mmalerba
parent d8a365e2b8
commit e8af5aed39
+8 -11
View File
@@ -110,8 +110,7 @@ export class MatIconRegistry {
constructor(
@Optional() private _httpClient: HttpClient,
private _sanitizer: DomSanitizer,
@Optional() @Inject(DOCUMENT) document?: any) {
// TODO(crisbeto): make _document required next major release.
@Optional() @Inject(DOCUMENT) document: any) {
this._document = document;
}
@@ -427,17 +426,15 @@ export class MatIconRegistry {
* Creates a DOM element from the given SVG string.
*/
private _svgElementFromString(str: string): SVGElement {
if (this._document || typeof document !== 'undefined') {
const div = (this._document || document).createElement('DIV');
div.innerHTML = str;
const svg = div.querySelector('svg') as SVGElement;
if (!svg) {
throw Error('<svg> tag not found');
}
return svg;
const div = this._document.createElement('DIV');
div.innerHTML = str;
const svg = div.querySelector('svg') as SVGElement;
if (!svg) {
throw Error('<svg> tag not found');
}
throw new Error('MatIconRegistry could not resolve document.');
return svg;
}
/**