From d8b3601927e4a499ec831835f0d04bd147d4a2d0 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 26 Oct 2015 16:34:40 -0700 Subject: [PATCH] fix(style_url_resolver): include `asset:` urls into precompiled stylesheets. Closes #4926 --- modules/angular2/src/core/compiler/style_url_resolver.ts | 2 +- modules/angular2/test/core/compiler/style_url_resolver_spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/angular2/src/core/compiler/style_url_resolver.ts b/modules/angular2/src/core/compiler/style_url_resolver.ts index 70b9fee499..7736514d90 100644 --- a/modules/angular2/src/core/compiler/style_url_resolver.ts +++ b/modules/angular2/src/core/compiler/style_url_resolver.ts @@ -17,7 +17,7 @@ export class StyleWithImports { export function isStyleUrlResolvable(url: string): boolean { if (isBlank(url) || url.length === 0 || url[0] == '/') return false; var schemeMatch = RegExpWrapper.firstMatch(_urlWithSchemaRe, url); - return isBlank(schemeMatch) || schemeMatch[1] == 'package'; + return isBlank(schemeMatch) || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; } /** diff --git a/modules/angular2/test/core/compiler/style_url_resolver_spec.ts b/modules/angular2/test/core/compiler/style_url_resolver_spec.ts index ba0bba5d89..9edf03a422 100644 --- a/modules/angular2/test/core/compiler/style_url_resolver_spec.ts +++ b/modules/angular2/test/core/compiler/style_url_resolver_spec.ts @@ -87,7 +87,7 @@ export function main() { () => { expect(isStyleUrlResolvable('package:someUrl.css')).toBe(true); }); it('should resolve asset: urls', - () => { expect(isStyleUrlResolvable('package:someUrl.css')).toBe(true); }); + () => { expect(isStyleUrlResolvable('asset:someUrl.css')).toBe(true); }); it('should not resolve empty urls', () => { expect(isStyleUrlResolvable(null)).toBe(false);