Last active
June 23, 2016 21:00
-
-
Save braindroplabs/7febe68a395e9017ae0b4f798b9dcf64 to your computer and use it in GitHub Desktop.
How is transclusion (content projection) done in Angular 2 when using SVG?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<my-custom-svg [width]="500" [height]="300"> | |
<g my-custom-content-projected-svg [item]="item"></g> | |
</my-custom-svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg:circle [attr.cx]="item.x" [attr.cy]="item.y" [attr.r]="item.r"></svg:circle> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" [attr.width]="width" [attr.height]="height"> | |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" *ngFor="let item of items"> | |
<ng-content></ng-content> | |
</svg> | |
</svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment