2017-01-03 86 views
0

我在Angular2上發生了錯誤。 我需要重新啓動我的電腦,然後再回到項目中,無論如何 - 錯誤不斷顯示!angular 2記住我的錯誤,無論我做什麼

我刪除了所有的代碼,甚至去了,從我的index.html刪除"<my-app>Loading...</my-app>"代碼片段,錯誤仍然存​​在。

的錯誤是:

nhandled Promise rejection: Template parse errors: 
Can't bind to 'alert' since it isn't a known property of 'div'. (" 
    </div> 

    <div class="alert valign center-align" [ERROR ->][alert]="alert" *ngIf="alert">Please Provide Title and Text</div> 
    "): [email protected]:41 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors: 
Can't bind to 'alert' since it isn't a known property of 'div'. (" 
    </div> 

    <div class="alert valign center-align" [ERROR ->][alert]="alert" *ngIf="alert">Please Provide Title and Text</div> 

(清除緩存以及..)

任何想法可能是什麼?

+0

這將幫助我們,如果你告訴我們是什麼錯誤。 – StephaneM

+0

@StephaneM謝謝,編輯了這個問題 – thormayer

回答

0

您是否嘗試過刪除您node_modules文件夾,然後運行...

npm install 

它可以幫助的東西可能會發生在你的包。

,或者必須有它的「警報」屬性的div中。嘗試刪除該屬性。

+0

我做到了,它仍然顯示。同時,我刪除了警報屬性(甚至刪除從我的index.html – thormayer

+0

如果刪除了就可以了「警報」整個DIV會發生什麼應用程序標籤?也可以嘗試刪除該ngIf,那麼如果它呈現我們可以開始加上位回,看看我們能找出問題到底是什麼。 –

+0

這就是我所做的。 基本上我取出全部標籤一起 – thormayer

0

嘛,alert不是div標籤的原生屬性。 您可以使用一個Directive添加屬性,或者如果你真的只是想填補了屬性,使用適當的結合,像這樣:

[attr.alert]="alert" 
+0

我沒有它,我刪除它,它仍然顯示 – thormayer