2016-11-25 98 views
0

我需要爲鏈接分配動態html標記內容。 現在我有兩個鏈接,其中一個禁用。但我需要通過在Angular 1代碼中調用函數來動態指定它是否被禁用。使用角度功能分配動態html標記內容

<link rel="stylesheet" href="css/blue.css" title="blue" disabled/> 
<link rel="stylesheet" href="css/red.css" title="red" /> 

非常感謝您的幫助。

回答

0

您需要使用該指令ng-disabled。您可以在AngularJS的official documentation上了解有關此指令的更多信息。

<link rel="stylesheet" href="css/blue.css" title="blue" ng-disabled="expression" /> 
<link rel="stylesheet" href="css/red.css" title="red" ng-disabled="expression" /> 
:實施你的案件

0

您需要使用ng-disabled

<link rel="stylesheet" href="css/blue.css" title="blue" 
     ng-disabled="{condition}" />