TypeScript @angular-compiler-src-style_url_resolver.extractStyleUrls类(方法)实例源码

下面列出了TypeScript @angular-compiler-src-style_url_resolver.extractStyleUrls 类(方法)源码代码实例,从而了解它的用法。

作者:aftab1066    项目:angula   
it('should extract "@import urls and keep rules in the same line', () => {
   var css = `@import url('some.css');div {color: red};`;
   var styleWithImports = extractStyleUrls(urlResolver, 'http://ng.io', css);
   expect(styleWithImports.style.trim()).toEqual('div {color: red};');
   expect(styleWithImports.styleUrls).toEqual(['http://ng.io/some.css']);
 });

作者:0xJoK    项目:angula   
it('should resolve package @import urls', () => {
   var css = `@import url('package:a/b/some.css');`;
   var styleWithImports = extractStyleUrls(new FakeUrlResolver(), 'http://ng.io', css);
   expect(styleWithImports.style.trim()).toEqual(``);
   expect(styleWithImports.styleUrls).toEqual(['fake_resolved_url']);
 });


问题


面经


文章

微信
公众号

扫码关注公众号