簡體   English   中英

按鈕屬性綁定“禁用”在角度4中不起作用

[英]button property binding “disable” not working in angular 4

我已經創建了一個組件名稱服務器。 在servers.component.ts中,我創建了一個變量名稱allowServer,其布爾值為false(以禁用應用程序啟動中的按鈕)。 在構造函數中,我使用了JavaScript setTimeout函數將allowServer的值更改為True。 值正在更改,但未啟用按鈕

servers.component.ts

server.component.html我在做什么錯?

您需要使用ArrowFunction()=>以保持在這個范圍內setTimeOut

setTimeout(()=>{    
      this.allowServer = true;
 },3000);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM