"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/icon/icon.ts" between
material2-7.3.5.tar.gz and material2-7.3.6.tar.gz

About: material2 offers Material Design components for Angular.

icon.ts  (material2-7.3.5):icon.ts  (material2-7.3.6)
skipping to change at line 224 skipping to change at line 224
const parts = iconName.split(':'); const parts = iconName.split(':');
switch (parts.length) { switch (parts.length) {
case 1: return ['', parts[0]]; // Use default namespace. case 1: return ['', parts[0]]; // Use default namespace.
case 2: return <[string, string]>parts; case 2: return <[string, string]>parts;
default: throw Error(`Invalid icon name: "${iconName}"`); default: throw Error(`Invalid icon name: "${iconName}"`);
} }
} }
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
// Only update the inline SVG icon if the inputs changed, to avoid unnecessa ry DOM operations. // Only update the inline SVG icon if the inputs changed, to avoid unnecessa ry DOM operations.
if (changes['svgIcon']) { const svgIconChanges = changes['svgIcon'];
if (svgIconChanges) {
if (this.svgIcon) { if (this.svgIcon) {
const [namespace, iconName] = this._splitIconName(this.svgIcon); const [namespace, iconName] = this._splitIconName(this.svgIcon);
this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).su bscribe( this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).su bscribe(
svg => this._setSvgElement(svg), svg => this._setSvgElement(svg),
(err: Error) => console.log(`Error retrieving icon: ${err.message}`) (err: Error) => console.log(`Error retrieving icon: ${err.message}`)
); );
} else { } else if (svgIconChanges.previousValue) {
this._clearSvgElement(); this._clearSvgElement();
} }
} }
if (this._usingFontIcon()) { if (this._usingFontIcon()) {
this._updateFontIconClasses(); this._updateFontIconClasses();
} }
} }
ngOnInit() { ngOnInit() {
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)