Created
November 5, 2017 20:10
-
-
Save arutnik/ad61e6a428b76bfa8493deb982e9818e to your computer and use it in GitHub Desktop.
SFA Part 4: Static asset pipe
This file contains hidden or 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
| declare var getSfStaticResourceRoot : () => string; | |
| export function getStaticPathForResource(resourcePath : string) { | |
| return getSfStaticResourceRoot() + resourcePath; | |
| } | |
| /* | |
| * Ensures a static asset path gets the right prefix | |
| */ | |
| @Pipe({name: 'staticpath'}) | |
| export class StaticPathPipe implements PipeTransform { | |
| transform(value: string): string { | |
| return getStaticPathForResource(value); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment