Angular 角度自定义组件修饰符中断URL

Angular 角度自定义组件修饰符中断URL,angular,decorator,Angular,Decorator,我想扩展ng组件装饰器来设置默认配置。找到了一种简单的方法来定义自定义一个,并在其中调用ng一个。 不幸的是,使用自定义装饰器似乎破坏了html模板和css/scss URL MyComponent.ts import { Component, forwardRef, TypeDecorator } from "@angular/core"; line-list.component"; export function MyComponent(annotation:

我想扩展ng组件装饰器来设置默认配置。找到了一种简单的方法来定义自定义一个,并在其中调用ng一个。 不幸的是,使用自定义装饰器似乎破坏了html模板和css/scss URL

MyComponent.ts

import { Component, forwardRef, TypeDecorator } from "@angular/core";
line-list.component";

export function MyComponent(annotation: Component) {

    return (target: Function) => {
        let ngCompDef;

        //add 'automatic' metadata
        annotation.providers = annotation.providers || [];
        annotation.providers.push(
            {
                provide: WorkflowableComponent,
                useExisting: forwardRef(()=>target)
            }
        )

        //link to ng Component decorator f.
        ngCompDef = Component(annotation);
        ngCompDef(target);
    }

}
@MyComponent({
    selector: 'acomponent',
    template: LIST_PAGE_BASE_TEMPLATE, //using 'inline' templates works
    styleUrls: ['./a-component.scss'] //referencing 'external' resources does not work
})
export class AComponent extends ListPageBase<ItemCheckLine>
    implements OnInit {
...
a-component.ts

import { Component, forwardRef, TypeDecorator } from "@angular/core";
line-list.component";

export function MyComponent(annotation: Component) {

    return (target: Function) => {
        let ngCompDef;

        //add 'automatic' metadata
        annotation.providers = annotation.providers || [];
        annotation.providers.push(
            {
                provide: WorkflowableComponent,
                useExisting: forwardRef(()=>target)
            }
        )

        //link to ng Component decorator f.
        ngCompDef = Component(annotation);
        ngCompDef(target);
    }

}
@MyComponent({
    selector: 'acomponent',
    template: LIST_PAGE_BASE_TEMPLATE, //using 'inline' templates works
    styleUrls: ['./a-component.scss'] //referencing 'external' resources does not work
})
export class AComponent extends ListPageBase<ItemCheckLine>
    implements OnInit {
...
@MyComponent({
选择器:“acomponent”,
模板:LIST\u PAGE\u BASE\u模板,//使用“inline”模板很有效
styleUrls:['./a-component.scss']//引用“外部”资源无效
})
导出类组件扩展ListPageBase
实现OnInit{
...
引发的错误是: 错误:未捕获(承诺中):加载a-component.styles.scss失败 在resolvePromise(zone.js:852)


谢谢。

使用angular 8.2和angular cli 8.2