我有一個關於帶有angularJs指令的樣式的問題。我已經爲我的項目中的progressbar導入了一個bootstrap指令。我在我創建的div類中使用它。不適用的角度指令
<div class="diagnostics-widget-modal">
<div class="modal-header">
<h3>SOME CONTENT</h3>
</div>
<div class="modal-body">
<div class=left-workflow-area>
<uib-progressbar value="55"></uib-progressbar>
</div>
</div>
</div>
當我運行我的頁面時,指令html被正確渲染,並且那段代碼變成了以下內容。
<div class="modal-body">
<div class="left-workflow-area">
<div class="progressbar ng-isolate-scope" value="55">
<div class="progress">
<div class="progress-bar" ng-class="type && 'progress-bar-' + type" role="progressbar" aria-valuenow="55" aria-valuemin="0" aria-valuemax="100" ng-style="{width: (percent < 100 ? percent: 100) + '%'}" aria-valuetext="%" aria-labelledby="" ng-transclude="" style="width: 100%;"> </div>
</div>
</div>
</div>
</div>
我想要的是風格的「進步」和「進度欄」類。我有一個定義左工作流區域的scss。
.diagnostics-widget-modal {
height: 100%;
width: 100%;
.modal-header {
height: 71px;
padding: 0 12px 0px 36px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.modal-close {
width: 72px;
height: 72px;
display: flex;
align-items: center;
justify-content: center;
}
}
.modal-body {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 90%;
.left-workflow-area {
display: flex;
width: 70%;
height: 100%;
}
.right-workflow-area {
display: flex;
width: 30%;
height: 100%;
}
}
我有一個沒有被應用的指令的樣式文件。
.progress {
height: 20px;
margin-bottom: 20px;
overflow: hidden;
background-color: #f5f5f5
border-radius: 4px;
box-shadow: inset 0 1px 2px rgba (0,0,0,.1);
}
如果我在「left-workflow-area」內聲明該類正在正確應用。但我想保持這種風格appart,因爲這是一個指令,將在我的應用程序的不同部分使用。我怎樣才能做到這一點?
您好,感謝您的答覆。我沒有包含在我的項目中的CSS樣式,這就是爲什麼我要寫它們。所以我的問題是,我根本沒有任何風格 – acostela
你必須有css,否則根本沒有規則可以應用,''.left-workflow-area''內部或外部的''.progress''位置無關緊要。而且,正如[angular bootstrap](https://angular-ui.github.io/bootstrap/#/getting_started)中提到的那樣,bootstrap css是必需的 – jibe