angular-svg-icon
Advanced tools
Comparing version 4.2.6 to 5.0.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/http'), require('rxjs/Observable'), require('rxjs/add/observable/of'), require('rxjs/add/operator/do'), require('rxjs/add/operator/finally'), require('rxjs/add/operator/map'), require('rxjs/add/operator/share')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@angular/http', 'rxjs/Observable', 'rxjs/add/observable/of', 'rxjs/add/operator/do', 'rxjs/add/operator/finally', 'rxjs/add/operator/map', 'rxjs/add/operator/share'], factory) : | ||
(factory((global['angular-svg-icon'] = global['angular-svg-icon'] || {}),global.ng.core,global.ng.common,global.ng.http,global.Rx)); | ||
}(this, (function (exports,_angular_core,_angular_common,_angular_http,rxjs_Observable) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/Observable'), require('rxjs/add/observable/of'), require('rxjs/add/operator/do'), require('rxjs/add/operator/finally'), require('rxjs/add/operator/map'), require('rxjs/add/operator/share')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/Observable', 'rxjs/add/observable/of', 'rxjs/add/operator/do', 'rxjs/add/operator/finally', 'rxjs/add/operator/map', 'rxjs/add/operator/share'], factory) : | ||
(factory((global['angular-svg-icon'] = {}),global.ng.core,global.ng.common,global.ng.common.http,global.Rx)); | ||
}(this, (function (exports,core,common,http,Observable) { 'use strict'; | ||
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { | ||
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
@@ -13,8 +13,8 @@ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
}; | ||
var __metadata$1 = (undefined && undefined.__metadata) || function (k, v) { | ||
var __metadata = (undefined && undefined.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
exports.SvgIconRegistryService = (function () { | ||
function SvgIconRegistryService(http) { | ||
this.http = http; | ||
var SvgIconRegistryService = (function () { | ||
function SvgIconRegistryService(http$$1) { | ||
this.http = http$$1; | ||
this.iconsByUrl = new Map(); | ||
@@ -26,3 +26,3 @@ this.iconsLoadingByUrl = new Map(); | ||
if (this.iconsByUrl.has(url)) { | ||
return rxjs_Observable.Observable.of(this.iconsByUrl.get(url)); | ||
return Observable.Observable.of(this.iconsByUrl.get(url)); | ||
} | ||
@@ -33,6 +33,6 @@ else if (this.iconsLoadingByUrl.has(url)) { | ||
else { | ||
var o = this.http.get(url) | ||
.map(function (res) { | ||
var o = this.http.get(url, { responseType: 'text' }) | ||
.map(function (svg) { | ||
var div = document.createElement('DIV'); | ||
div.innerHTML = res.text(); | ||
div.innerHTML = svg; | ||
return div.querySelector('svg'); | ||
@@ -56,10 +56,18 @@ }) | ||
}; | ||
SvgIconRegistryService = __decorate$1([ | ||
core.Injectable(), | ||
__metadata("design:paramtypes", [http.HttpClient]) | ||
], SvgIconRegistryService); | ||
return SvgIconRegistryService; | ||
}()); | ||
exports.SvgIconRegistryService = __decorate$2([ | ||
_angular_core.Injectable(), | ||
__metadata$1("design:paramtypes", [_angular_http.Http]) | ||
], exports.SvgIconRegistryService); | ||
function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, http$$1) { | ||
return parentRegistry || new SvgIconRegistryService(http$$1); | ||
} | ||
var SVG_ICON_REGISTRY_PROVIDER = { | ||
provide: SvgIconRegistryService, | ||
deps: [[new core.Optional(), new core.SkipSelf(), SvgIconRegistryService], http.HttpClient], | ||
useFactory: SVG_ICON_REGISTRY_PROVIDER_FACTORY | ||
}; | ||
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { | ||
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
@@ -70,6 +78,6 @@ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
}; | ||
var __metadata = (undefined && undefined.__metadata) || function (k, v) { | ||
var __metadata$1 = (undefined && undefined.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
exports.SvgIconComponent = (function () { | ||
var SvgIconComponent = (function () { | ||
function SvgIconComponent(element, renderer, iconReg) { | ||
@@ -109,25 +117,17 @@ this.element = element; | ||
}; | ||
__decorate$2([ | ||
core.Input(), | ||
__metadata$1("design:type", String) | ||
], SvgIconComponent.prototype, "src", void 0); | ||
SvgIconComponent = __decorate$2([ | ||
core.Component({ | ||
selector: 'svg-icon', | ||
styles: [':host { display:inline-block; }'], | ||
template: '<ng-content></ng-content>' | ||
}), | ||
__metadata$1("design:paramtypes", [core.ElementRef, core.Renderer, | ||
SvgIconRegistryService]) | ||
], SvgIconComponent); | ||
return SvgIconComponent; | ||
}()); | ||
__decorate$1([ | ||
_angular_core.Input(), | ||
__metadata("design:type", String) | ||
], exports.SvgIconComponent.prototype, "src", void 0); | ||
exports.SvgIconComponent = __decorate$1([ | ||
_angular_core.Component({ | ||
selector: 'svg-icon', | ||
styles: [':host { display:inline-block; }'], | ||
template: '<ng-content></ng-content>' | ||
}), | ||
__metadata("design:paramtypes", [_angular_core.ElementRef, _angular_core.Renderer, | ||
exports.SvgIconRegistryService]) | ||
], exports.SvgIconComponent); | ||
function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, http) { | ||
return parentRegistry || new exports.SvgIconRegistryService(http); | ||
} | ||
var SVG_ICON_REGISTRY_PROVIDER = { | ||
provide: exports.SvgIconRegistryService, | ||
deps: [[new _angular_core.Optional(), new _angular_core.SkipSelf(), exports.SvgIconRegistryService], _angular_http.Http], | ||
useFactory: SVG_ICON_REGISTRY_PROVIDER_FACTORY | ||
}; | ||
@@ -140,21 +140,23 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
exports.AngularSvgIconModule = (function () { | ||
var AngularSvgIconModule = (function () { | ||
function AngularSvgIconModule() { | ||
} | ||
AngularSvgIconModule = __decorate([ | ||
core.NgModule({ | ||
imports: [ | ||
common.CommonModule, | ||
], | ||
declarations: [SvgIconComponent], | ||
providers: [SVG_ICON_REGISTRY_PROVIDER], | ||
exports: [SvgIconComponent] | ||
}) | ||
], AngularSvgIconModule); | ||
return AngularSvgIconModule; | ||
}()); | ||
exports.AngularSvgIconModule = __decorate([ | ||
_angular_core.NgModule({ | ||
imports: [ | ||
_angular_common.CommonModule, | ||
_angular_http.HttpModule | ||
], | ||
declarations: [exports.SvgIconComponent], | ||
providers: [SVG_ICON_REGISTRY_PROVIDER], | ||
exports: [exports.SvgIconComponent] | ||
}) | ||
], exports.AngularSvgIconModule); | ||
exports.AngularSvgIconModule = AngularSvgIconModule; | ||
exports.SvgIconRegistryService = SvgIconRegistryService; | ||
exports.SVG_ICON_REGISTRY_PROVIDER_FACTORY = SVG_ICON_REGISTRY_PROVIDER_FACTORY; | ||
exports.SVG_ICON_REGISTRY_PROVIDER = SVG_ICON_REGISTRY_PROVIDER; | ||
exports.SvgIconComponent = SvgIconComponent; | ||
@@ -161,0 +163,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { HttpModule } from '@angular/http'; | ||
import { SvgIconComponent, SVG_ICON_REGISTRY_PROVIDER } from './svg-icon.component'; | ||
import { SVG_ICON_REGISTRY_PROVIDER } from './svg-icon-registry.service'; | ||
import { SvgIconComponent } from './svg-icon.component'; | ||
var AngularSvgIconModule = (function () { | ||
function AngularSvgIconModule() { | ||
} | ||
AngularSvgIconModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
imports: [ | ||
CommonModule, | ||
], | ||
declarations: [SvgIconComponent], | ||
providers: [SVG_ICON_REGISTRY_PROVIDER], | ||
exports: [SvgIconComponent] | ||
},] }, | ||
]; | ||
AngularSvgIconModule.ctorParameters = function () { return []; }; | ||
return AngularSvgIconModule; | ||
}()); | ||
export { AngularSvgIconModule }; | ||
AngularSvgIconModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
imports: [ | ||
CommonModule, | ||
HttpModule | ||
], | ||
declarations: [SvgIconComponent], | ||
providers: [SVG_ICON_REGISTRY_PROVIDER], | ||
exports: [SvgIconComponent] | ||
},] }, | ||
]; | ||
AngularSvgIconModule.ctorParameters = function () { return []; }; | ||
//# sourceMappingURL=angular-svg-icon.module.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"AngularSvgIconModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/http","name":"HttpModule"}],"declarations":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}],"providers":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SVG_ICON_REGISTRY_PROVIDER"}],"exports":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"AngularSvgIconModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/http","name":"HttpModule"}],"declarations":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}],"providers":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SVG_ICON_REGISTRY_PROVIDER"}],"exports":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}]}]}]}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"AngularSvgIconModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}],"providers":[{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SVG_ICON_REGISTRY_PROVIDER"}],"exports":[{"__symbolic":"reference","module":"./svg-icon.component","name":"SvgIconComponent"}]}]}]}}}] |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./angular-svg-icon.module"},{"from":"./svg-icon-registry.service"},{"from":"./svg-icon.component"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./angular-svg-icon.module"},{"from":"./svg-icon-registry.service"},{"from":"./svg-icon.component"}]}] | ||
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./angular-svg-icon.module"},{"from":"./svg-icon-registry.service"},{"from":"./svg-icon.component"}]}] |
{ | ||
"name": "angular-svg-icon", | ||
"description": "Angular 2+ component for inlining SVGs allowing them to be easily styled with CSS.", | ||
"version": "4.2.6", | ||
"description": "Angular 5 component for inlining SVGs allowing them to be easily styled with CSS.", | ||
"version": "5.0.0", | ||
"repository": { | ||
@@ -20,6 +20,6 @@ "type": "git", | ||
"peerDependencies": { | ||
"@angular/core": "^2.4.0 || ^4.0.0 || ^5.0.0", | ||
"@angular/http": "^2.4.0 || ^4.0.0 || ^5.0.0", | ||
"rxjs": "^5.2.0" | ||
"@angular/core": "^4.3.0 || ^5.0.0", | ||
"@angular/common": "^4.3.0 || ^5.0.0", | ||
"rxjs": "^5.5.2" | ||
} | ||
} |
[![npm version](https://badge.fury.io/js/angular-svg-icon.svg)](https://badge.fury.io/js/angular-svg-icon) | ||
Angular SVG Icon | ||
Angular SVG Icon | ||
========= | ||
The **angular-svg-icon** is an Angular 2+ service and component that provides a | ||
means to inline SVG images to allow for them to be easily styled by CSS and | ||
code. | ||
The **angular-svg-icon** is an Angular 4.3+ service and component that provides a | ||
means to inline SVG files to allow for them to be easily styled by CSS and code. | ||
The service provides an icon registery that loads and caches a svg indexed by | ||
its url. The component is responsible for displaying the svg. After getting the | ||
svg from the registry it clones the `SVGElement` and the svg to the component's | ||
The service provides an icon registery that loads and caches a SVG indexed by | ||
its url. The component is responsible for displaying the SVG. After getting the | ||
svg from the registry it clones the `SVGElement` and the SVG to the component's | ||
inner HTML. | ||
A [working demo](http://czeckd.github.io/angular-svg-icon/demo/) shows solution | ||
in action. | ||
A [working demo](http://czeckd.github.io/angular-svg-icon/demo/) shows solution in action. | ||
@@ -22,13 +20,16 @@ ## How to use? | ||
``` | ||
(**Note:** For use Angular 2.4 through Angular 4.2, please install angular-svg-icon@4.2.6 | ||
and see the module's accompanying README.md for instructions.) | ||
## Integration | ||
The **angular-svg-icon** should work as-is with webpack/angular-cli. Just add | ||
the ``AngularSvgIconModule``. | ||
The **angular-svg-icon** should work as-is with webpack/angular-cli. Just import the | ||
``AngularSvgIconModule`` and the ```HttpClientModule```. | ||
```typescript | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { AngularSvgIconModule } from 'angular-svg-icon'; | ||
@NgModule({ | ||
imports: [ AngularSvgIconModule ], | ||
imports: [ HttpClientModule, AngularSvgIconModule ], | ||
... | ||
@@ -56,3 +57,3 @@ }) | ||
To preload a svg file into the registry: | ||
To preload a svg file into the registry: | ||
@@ -64,3 +65,3 @@ ```typescript | ||
} | ||
``` | ||
``` | ||
@@ -76,18 +77,25 @@ To unload a svg from the registry. | ||
## SVG Preparation | ||
The SVG should be modified to remove the height and width attributes from the file | ||
per Sara Soueidan's advice in "[Making SVGs Responsive With | ||
CSS](http://tympanus.net/codrops/2014/08/19/making-svgs-responsive-with-css/)" if | ||
size is to be modified through CSS. Removing the height and width has two immedate | ||
impacts: (1) CSS can be used to size the SVG, and (2) CSS will be *required* to | ||
size the SVG. | ||
## Background | ||
The svg-icon is an Angular 2 component that allows for the continuation of the | ||
AngularJS method for easily inlining SVGs explained by [Ben | ||
Markowitz](https://www.mobomo.com/2014/09/angular-js-svg/) and others. Including | ||
The svg-icon is an Angular 2 component that allows for the continuation of the | ||
AngularJS method for easily inlining SVGs explained by [Ben | ||
Markowitz](https://www.mobomo.com/2014/09/angular-js-svg/) and others. Including | ||
the SVG source inline allows for the graphic to be easily styled by CSS. | ||
The technique made use of ng-include to inline the svg source into the document. | ||
Angular 2, however, drops the support of ng-include, so this is my work-around | ||
The technique made use of ng-include to inline the svg source into the document. | ||
Angular 2, however, drops the support of ng-include, so this is my work-around | ||
method. | ||
*Note:* The [icon | ||
component](https://www.npmjs.com/package/@angular2-material/icon) from | ||
[angular/material2](https://github.com/angular/material2) used to have a direct | ||
means to load svg similar to this, but this functionality was removed because of | ||
*Note:* The [icon | ||
component](https://www.npmjs.com/package/@angular2-material/icon) from | ||
[angular/material2](https://github.com/angular/material2) used to have a direct | ||
means to load svg similar to this, but this functionality was removed because of | ||
security concerns. | ||
@@ -94,0 +102,0 @@ |
@@ -1,2 +0,3 @@ | ||
import { Http } from '@angular/http'; | ||
import { Optional } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -12,5 +13,11 @@ import 'rxjs/add/observable/of'; | ||
private iconsLoadingByUrl; | ||
constructor(http: Http); | ||
constructor(http: HttpClient); | ||
loadSvg(url: string): Observable<SVGElement>; | ||
unloadSvg(url: string): void; | ||
} | ||
export declare function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry: SvgIconRegistryService, http: HttpClient): SvgIconRegistryService; | ||
export declare const SVG_ICON_REGISTRY_PROVIDER: { | ||
provide: typeof SvgIconRegistryService; | ||
deps: (typeof HttpClient | Optional[])[]; | ||
useFactory: (parentRegistry: SvgIconRegistryService, http: HttpClient) => SvgIconRegistryService; | ||
}; |
@@ -1,3 +0,3 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
import { Injectable, Optional, SkipSelf } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -24,6 +24,6 @@ import 'rxjs/add/observable/of'; | ||
else { | ||
var o = this.http.get(url) | ||
.map(function (res) { | ||
var o = this.http.get(url, { responseType: 'text' }) | ||
.map(function (svg) { | ||
var div = document.createElement('DIV'); | ||
div.innerHTML = res.text(); | ||
div.innerHTML = svg; | ||
return div.querySelector('svg'); | ||
@@ -47,11 +47,19 @@ }) | ||
}; | ||
SvgIconRegistryService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
SvgIconRegistryService.ctorParameters = function () { return [ | ||
{ type: HttpClient, }, | ||
]; }; | ||
return SvgIconRegistryService; | ||
}()); | ||
export { SvgIconRegistryService }; | ||
SvgIconRegistryService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
SvgIconRegistryService.ctorParameters = function () { return [ | ||
{ type: Http, }, | ||
]; }; | ||
export function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, http) { | ||
return parentRegistry || new SvgIconRegistryService(http); | ||
} | ||
export var SVG_ICON_REGISTRY_PROVIDER = { | ||
provide: SvgIconRegistryService, | ||
deps: [[new Optional(), new SkipSelf(), SvgIconRegistryService], HttpClient], | ||
useFactory: SVG_ICON_REGISTRY_PROVIDER_FACTORY | ||
}; | ||
//# sourceMappingURL=svg-icon-registry.service.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"SvgIconRegistryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"}]}],"loadSvg":[{"__symbolic":"method"}],"unloadSvg":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"SvgIconRegistryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"}]}],"loadSvg":[{"__symbolic":"method"}],"unloadSvg":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"SvgIconRegistryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}]}],"loadSvg":[{"__symbolic":"method"}],"unloadSvg":[{"__symbolic":"method"}]}},"SVG_ICON_REGISTRY_PROVIDER_FACTORY":{"__symbolic":"function","parameters":["parentRegistry","http"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentRegistry"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SvgIconRegistryService"},"arguments":[{"__symbolic":"reference","name":"http"}]}}},"SVG_ICON_REGISTRY_PROVIDER":{"provide":{"__symbolic":"reference","name":"SvgIconRegistryService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","name":"SvgIconRegistryService"}],{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}],"useFactory":{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER_FACTORY"}}}}] |
@@ -1,3 +0,2 @@ | ||
import { ElementRef, OnChanges, OnDestroy, OnInit, Optional, Renderer, SimpleChange } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
import { ElementRef, OnChanges, OnDestroy, OnInit, Renderer, SimpleChange } from '@angular/core'; | ||
import { SvgIconRegistryService } from './svg-icon-registry.service'; | ||
@@ -20,7 +19,1 @@ export declare class SvgIconComponent implements OnInit, OnDestroy, OnChanges { | ||
} | ||
export declare function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry: SvgIconRegistryService, http: Http): SvgIconRegistryService; | ||
export declare const SVG_ICON_REGISTRY_PROVIDER: { | ||
provide: typeof SvgIconRegistryService; | ||
deps: (typeof Http | Optional[])[]; | ||
useFactory: (parentRegistry: SvgIconRegistryService, http: Http) => SvgIconRegistryService; | ||
}; |
@@ -1,3 +0,2 @@ | ||
import { Component, ElementRef, Input, Optional, Renderer, SkipSelf } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
import { Component, ElementRef, Input, Renderer } from '@angular/core'; | ||
import { SvgIconRegistryService } from './svg-icon-registry.service'; | ||
@@ -39,28 +38,20 @@ var SvgIconComponent = (function () { | ||
}; | ||
SvgIconComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'svg-icon', | ||
styles: [':host { display:inline-block; }'], | ||
template: '<ng-content></ng-content>' | ||
},] }, | ||
]; | ||
SvgIconComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: Renderer, }, | ||
{ type: SvgIconRegistryService, }, | ||
]; }; | ||
SvgIconComponent.propDecorators = { | ||
"src": [{ type: Input },], | ||
}; | ||
return SvgIconComponent; | ||
}()); | ||
export { SvgIconComponent }; | ||
SvgIconComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'svg-icon', | ||
styles: [':host { display:inline-block; }'], | ||
template: '<ng-content></ng-content>' | ||
},] }, | ||
]; | ||
SvgIconComponent.ctorParameters = function () { return [ | ||
{ type: ElementRef, }, | ||
{ type: Renderer, }, | ||
{ type: SvgIconRegistryService, }, | ||
]; }; | ||
SvgIconComponent.propDecorators = { | ||
'src': [{ type: Input },], | ||
}; | ||
export function SVG_ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, http) { | ||
return parentRegistry || new SvgIconRegistryService(http); | ||
} | ||
export var SVG_ICON_REGISTRY_PROVIDER = { | ||
provide: SvgIconRegistryService, | ||
deps: [[new Optional(), new SkipSelf(), SvgIconRegistryService], Http], | ||
useFactory: SVG_ICON_REGISTRY_PROVIDER_FACTORY | ||
}; | ||
//# sourceMappingURL=svg-icon.component.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"SvgIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"svg-icon","styles":[":host { display:inline-block; }"],"template":"<ng-content></ng-content>"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"setSvg":[{"__symbolic":"method"}]}},"SVG_ICON_REGISTRY_PROVIDER_FACTORY":{"__symbolic":"function","parameters":["parentRegistry","http"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentRegistry"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"},"arguments":[{"__symbolic":"reference","name":"http"}]}}},"SVG_ICON_REGISTRY_PROVIDER":{"provide":{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"}],{"__symbolic":"reference","module":"@angular/http","name":"Http"}],"useFactory":{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER_FACTORY"}}}},{"__symbolic":"module","version":1,"metadata":{"SvgIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"svg-icon","styles":[":host { display:inline-block; }"],"template":"<ng-content></ng-content>"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"setSvg":[{"__symbolic":"method"}]}},"SVG_ICON_REGISTRY_PROVIDER_FACTORY":{"__symbolic":"function","parameters":["parentRegistry","http"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"parentRegistry"},"right":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"},"arguments":[{"__symbolic":"reference","name":"http"}]}}},"SVG_ICON_REGISTRY_PROVIDER":{"provide":{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}},{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"}],{"__symbolic":"reference","module":"@angular/http","name":"Http"}],"useFactory":{"__symbolic":"reference","name":"SVG_ICON_REGISTRY_PROVIDER_FACTORY"}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"SvgIconComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"svg-icon","styles":[":host { display:inline-block; }"],"template":"<ng-content></ng-content>"}]}],"members":{"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./svg-icon-registry.service","name":"SvgIconRegistryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"setSvg":[{"__symbolic":"method"}]}}}}] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107
26244