Angularjs:组件模块不可用

时间:2018-05-20 07:35:07

标签: angularjs typescript

在尝试在Angularjs中创建组件时,我肯定做错了什么。我收到一个错误:

Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

任何指针都会有所帮助。这是我的JSFiddle

1 个答案:

答案 0 :(得分:0)

尝试

    public foo(): string[] {
        return Object.keys(MyEnum).filter(k => {
            typeof MyEnum[k] === "number"
        }) as string[];
    }

Here is the updated fiddle