Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Commit

Permalink
Strip internal from declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
echeung-amzn committed Nov 4, 2016
1 parent 13573f0 commit b76efce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-inline-svg-demo",
"version": "0.0.1",
"version": "0.0.0",
"description": "Demo of ng2-inline-svg.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,7 +35,7 @@
"gh-pages": "^0.11.0",
"node-sass": "^3.11.1",
"ts-loader": "^1.0.0",
"typescript": "^2.0.6",
"typescript": "^2.0.7",
"webpack": "^1.13.3",
"webpack-dev-server": "^1.16.2"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@angular/platform-server": "^2.1.2",
"rxjs": "5.0.0-beta.12",
"tslint": "^3.15.1",
"typescript": "^2.0.6",
"typescript": "^2.0.7",
"zone.js": "^0.6.26"
}
}
4 changes: 4 additions & 0 deletions src/inline-svg.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class InlineSVGDirective implements OnInit, OnChanges {

@Output() onSVGInserted: EventEmitter<SVGElement> = new EventEmitter<SVGElement>();

/** @internal */
private _absUrl: string;

constructor(
Expand All @@ -43,6 +44,7 @@ export class InlineSVGDirective implements OnInit, OnChanges {
}
}

/** @internal */
private _insertSVG(): void {
// Check if a URL was actually passed into the directive
if (!this.inlineSVG) {
Expand Down Expand Up @@ -99,13 +101,15 @@ export class InlineSVGDirective implements OnInit, OnChanges {
}
}

/** @internal */
private _getAbsoluteUrl(url: string): string {
const base = this._document.createElement('BASE') as HTMLBaseElement;
base.href = url;

return base.href;
}

/** @internal */
private _removeAttributes(svg: SVGElement, attrs: Array<string>) {
const innerEls = svg.getElementsByTagName('*');

Expand Down
7 changes: 6 additions & 1 deletion src/svg-cache.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ import 'rxjs/add/operator/share';

@Injectable()
export class SVGCache {
/** @internal */
private static _cache: Map<string, SVGElement>;

/** @internal */
private static _inProgressReqs: Map<string, Observable<SVGElement>>;

constructor(
@Inject(DOCUMENT) private _document /*: HTMLDocument*/,
@Inject(DOCUMENT) private _document /*: HTMLDocument */,
private _http: Http) {
if (!SVGCache._cache) {
SVGCache._cache = new Map<string, SVGElement>();
Expand Down Expand Up @@ -55,6 +58,7 @@ export class SVGCache {
return req;
}

/** @internal */
private _svgElementFromString(str: string): SVGElement | never {
const div: HTMLElement = this._document.createElement('DIV');
div.innerHTML = str;
Expand All @@ -68,6 +72,7 @@ export class SVGCache {
return svg;
}

/** @internal */
private _cloneSVG(svg: SVGElement): SVGElement {
return svg.cloneNode(true) as SVGElement;
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"experimentalDecorators": true,
"declaration": true,
"removeComments": true,
"stripInternal": true,
"outDir": "lib/",
"lib": ["dom", "es5", "es2015.core", "es2015.collection", "es2015.promise"]
},
Expand Down

0 comments on commit b76efce

Please sign in to comment.