Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 角形手风琴航向_Css_Angularjs_Angularjs Directive - Fatal编程技术网

Css 角形手风琴航向

Css 角形手风琴航向,css,angularjs,angularjs-directive,Css,Angularjs,Angularjs Directive,我有一个手风琴,需要改变它的标题背景颜色的基础上传递给它的值。e、 g.红色或绿色。 在下面的示例中,我为每个商店名称都有一个标题行。如果商店停业,我需要将标题的背景标记为红色而不是绿色。我没办法让它工作 <accordion id="accordion1" close-others="true"> <accordion-group is-open="isopen" ng-repeat="store in stores"> <accordi

我有一个手风琴,需要改变它的标题背景颜色的基础上传递给它的值。e、 g.红色或绿色。
在下面的示例中,我为每个商店名称都有一个标题行。如果商店停业,我需要将标题的背景标记为红色而不是绿色。我没办法让它工作

   <accordion id="accordion1" close-others="true">
  <accordion-group is-open="isopen"  ng-repeat="store in stores">
       <accordion-heading class="container-fluid heading-highlight">
       {{store.StoreName}}
       </accordion-heading>
    <form name="form">
      <div class="form-row" ng-repeat="record in store.records">
       <table>
          <tr ng-formfield></tr>  //dynamic form directive
       </table>
     </div>
    </form>
  </accordion-group>
  </accordion>

{{store.StoreName}
//动态表单指令
我尝试使用以下指令,但无论我做了什么更改,都没有效果

app.directive('headingHighlight', function () {
    return {
        restrict: 'A',
        link: function ($scope, element, attrs, controller) {
            $scope.$watch(element.children(), function () {
                var children = element.children('.panel-heading');
                for (var i = 0; i < children.length; i++) {

                        angular.element(children[i]).css('background', 'red');

                }
            });
        }
    };
});
app.directive('headingHighlight',function(){
返回{
限制:“A”,
链接:函数($scope、element、attrs、controller){
$scope.$watch(element.children(),function(){
var children=element.children('.panel heading');
对于(变量i=0;i
工作指令如下:

app.directive('headingHighlight', function () {
        return {
            restrict: 'A',
            link: function (scope, element, attrs, controller) {

                scope.$watch(element, function () {        
                    if (scope.color.Highlight != null) {
                            var panelhead = element.children('.panel-heading');
                            panelhead.css({
                                'background-image': '-webkit-linear-gradient(top,' + scope.color.Highlight +
                                ' 0%,  #e8e8e8 100%)', 'background-repeat': 'repeat-x', 'height': '85px;'
                            });
                        }

                });

            }
        };
    });