Angular2 AOT样式无法正确加载

时间:2017-02-28 16:43:36

标签: angular typescript

我一直在尝试动态地为我的竞争对手添加样式一段时间,并且在AOT中没有任何作用。我现在有这个,但是当在AOT中构建时加载样式表:

import { filt } from './funcs';

@Component({
  selector: 'open-account',
  styleUrls: ['./open-account.component.scss', './open-account-widget-styles.component.scss'].filter(filt),
  templateUrl: './open-account.component.html',
})

funcs.js:

export function filt(elem, i) {
    if (i === 0) return true;
    if (i === 1 && window.location.href.indexOf('widget=true') > -1) return true;
}

两种样式表都没有加载。为什么这样,我该如何解决这个问题?

0 个答案:

没有答案