ng-style

    2熱度

    1回答

    我有div和ngStyle屬性。最初div看起來不錯。但是,當我更新ngStyle屬性中使用的屬性時,style標記未更新。所以這些更改不會反映到div。 這裏是我的意思的例子:http://plnkr.co/edit/YQIxJYEFWwbxiXr4HBwY?p=preview 最初div是綠色的。當您點擊下面的按鈕時,您可以看到ngStyle屬性以#ff0000(紅色)的顏色更新。但style

    102熱度

    5回答

    這應該是一個簡單的問題,但我似乎無法找到解決方案。 我有以下標記: <div style="width:20px; height:20px; margin-top:10px; border:solid 1px black; background-color:#ff0000;"></div> 我需要的背景顏色綁定到的範圍,所以我想這: <div style="{width:20px; heigh

    6熱度

    2回答

    不更新我創建在角的簡單指令,它產生一滾輪,以顯示一些產品。 我在與代碼的一部分的問題。 <ul ng-style="{'margin-left':{{currentMargin}}+'px'}"> <li ng-repeat="tyre in tyres" ng-style="{'width':{{liWidth}}+'px'}"> <div class="i

    0熱度

    1回答

    我必須缺少某些語法,但如果範圍變量未被填充,如何獲得默認背景顏色? 以下不爲我工作: ng-style="{('backgroundColor':button.color || '#FF6600')}" 然而,這句法作品別處: <p>{{button.label || 'Some Text'}}<p> 我在做什麼毛病NG風格的語法?

    3熱度

    4回答

    我有這樣的進度條 <div class="progress progress-striped" ng-class"{active: file.isUploading()}"> <div class="progress bar" role="progressbar" ng-style="{'width' : (file.sizeUploaded()/file.size * 100) + '

    1熱度

    1回答

    我在這裏遇到了一個非常奇怪的情況。 起初,我寫了一個簡單的指令。 mublABase.directive('parentSize', function() { return { link : function(scope, elem, attrs) { scope.parentSize = { width : elem.parent().widt

    3熱度

    1回答

    我正在嘗試使用角度向某個元素應用漸變,但與ngStyle沒有這樣做。 這裏是什麼,我儘量做到一個例子: http://run.plnkr.co/plunks/mwJBcWaJ1hqOUCsSyy8a/ 舊的鏈接,不工作了 http://run.plnkr.co/maDs3PSWw4Y5tDfb/ 在這個例子中我使用的是普通style="{{css}}",這是不推薦的方法如in the docume

    1熱度

    3回答

    我有2個指令:wa-hotspots & wa-tooltips。 論wa-hotspotsng-mouseover它需要的是wa-hotspot $指數和匹配指數將通過ng-class:on和ng-style="tooltipCoords"知名度和wa-tooltip位置。 注:由於wa-hotspots & wa-tooltips共享相同的收集page.hotspots,因此,他們通過共享德同

    68熱度

    7回答

    我想通過使用角度ng-style(我以前用相同的行爲嘗試過一個自定義指令)應用背景圖像到一個div,但它不似乎工作。 <nav class="navigation-grid-container" data-ng-class="{ bigger: isNavActive == true }" data-ng-controller="NavigationCtrl"