角度2错误TS2345

时间:2017-03-20 04:54:33

标签: angular

@Component({
  selector:'my-app', 
  template:`<h1>Hi there <\h1>
            <my-tut><\my-tut>`, 
  directives :[TutorialComponent] 
})

显示错误:

  

类型选择器的参数:string template:string;指令:typeof TutorialComponent [];}&#39;不能分配给Component类型的参数。对象文字只能指定已知属性,而类型Component中不存在指令。

1 个答案:

答案 0 :(得分:2)

已使用2.0.0-rc.6从@Component注释中删除了

@NgModule参数。它们现在包含在{{1}}

来源:HTML5 Reset

相关问题