2017-01-30 68 views
4

我最近使用角度2創建了一個簡單的項目。當我嘗試向app.component添加指令組件時,「指令」屬性有一個紅色下劃線。 有人告訴我這裏有什麼問題嗎?將指令添加到角度2組件

enter image description here

回答

7

指令,組件和管需要自RC.6

directives要添加到

@NgModule({ 
    declarations: [...] 

,並pipes@Component()除去當時的情況。

+1

https://github.com/angular/angular/blob/master/CHANGELOG.md#bug-fixes-27 – echonax

+0

@echonax - 這是官方嗎? – Rozane

+0

@Günter - 非常感謝。我不知道。抱歉,由於我沒有15個聲望,我無法投票答覆您的任何答案。 – Rozane