TypeScript error in Angular2 code: Cannot find name 'module'

前端 未结 11 1416
梦毁少年i
梦毁少年i 2020-11-30 03:13

I have defined the following Angular2 component:

import {Component} from \'angular2/core\';

@Component({
  selector: \'my-app\',
  moduleId: module.id,
  te         


        
11条回答
  •  情深已故
    2020-11-30 03:14

    It still did not work until i pasted this where i had module.id, on top of component. like this

    declare var module: NodeModule;
    interface NodeModule
    {
    id: string;
    }

    @Component({module.id})

提交回复
热议问题