Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.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
Angularjs 角js清除选项卡标题_Angularjs - Fatal编程技术网

Angularjs 角js清除选项卡标题

Angularjs 角js清除选项卡标题,angularjs,Angularjs,我对选项卡式内容使用角度指令 如何清除选项卡标题?清除内容,但不清除标题 gfApp.directive('myTabs', function() { return { restrict: 'E', transclude: true, scope: {}, link: function(scope, element, attrs, tabsCtrl) { console.log(scope);

我对选项卡式内容使用角度指令

如何清除选项卡标题?清除内容,但不清除标题

  gfApp.directive('myTabs', function() {
    return {

        restrict: 'E',
        transclude: true,
        scope: {},
        link: function(scope, element, attrs, tabsCtrl) {
            console.log(scope);
            console.log("LOL");
        },
        controller: function($scope) {
            var panes = $scope.panes = [];

            var scope = $scope;

            $scope.select = function(pane) {
                angular.forEach(panes, function(pane) {
                    pane.selected = false;
                });

                if (pane.recommended === true) {
                    console.log(1);
                    pane.selected = true;
                } else {
                    console.log(2);
                    pane.selected = true;
                }
            //console.log($scope.$parent.recommended_shirts);
            };

            this.addPane = function(pane) {
                panes.push(pane);
                console.log(panes.length);
                if (panes.length  == $scope.$parent.recommended_shirts.length) {

                    angular.forEach(panes, function(pane) {
                        if (pane.recommended == 'true') {
                            $scope.select(pane);
                        }
                    });              
                }
            };
        },
        templateUrl: 'partial/my-tabs.html'
    };
})
.directive('myPane', function() {
    return {
        require: '^myTabs',
        restrict: 'E',
        transclude: true,
        scope: {
            title: '@',
            recommended: '@',
        },
        link: function(scope, element, attrs, tabsCtrl) {
            tabsCtrl.addPane(scope);
        },
        templateUrl: 'partial/my-pane.html'
        };
});
该视图如下所示

<my-tabs>
    <my-pane title="{{shirt.shirt_size}}{{shirt.star}}" ng-repeat="shirt in recommended_shirts" recommended="{{shirt.recommended}}">
        <div>
            <table ng-class="{selected:shirt.recommended}" style="margin: 5px auto; width: 96%" class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th width="168px">Area</th>
                        <th>Score</th>                                
                    </tr>                                
                </thead>
                <tbody>
                    <!--data-title="How to improve a Poor fit score:" data-content="Your Fit Score reflects the accuracy of your measurements based on the inputs you've given us. To improve your score, review your inputs for this particular part of your shirt and ensure that they are correct. Adding more shirts also improves the accuracy of your fit profile." -->
                    <tr>
                        <td>Collar</td>
                        <td>
                            <span>{{shirt.area.collar.result.result}}<span>
                        </td>
                    </tr>
                    <tr>
                        <td>Sleeve</td>
                        <td>
                            <span>{{shirt.area.half_shoulder_sleeve.result.result}}<span>
                        </td>
                    </tr>
                    <tr>
                        <td>Chest</td>
                        <td>
                            <span>{{shirt.area.collar.result.result}}<span>
                        </td>
                    </tr>

                    <tr ng-hide="shirt.show_more">
                        <td colspan="2" ng-click="shirt.show_more = !shirt.show_more">
                            Show more
                        </td>
                    </tr>
                    <tr ng-show="shirt.show_more">
                        <td>Waist</td>
                        <td>
                             <span>{{shirt.area.waist.result.result}}<span>
                        </td>
                    </tr>                            
                    <tr ng-show="shirt.show_more">
                        <td>Hips</td>
                        <td class="">
                             <span>{{shirt.area.hips.result.result}}<span>
                        </td>
                    </tr>                            
                    <tr ng-show="shirt.show_more">
                        <td>Length</td>
                        <td>
                             <span>{{shirt.area.length.result.result}}<span>
                        </td>
                    </tr>
                    <tr ng-show="shirt.show_more">
                        <td>Shoulder</td>
                        <td>
                            <span>{{shirt.area.shoulder.result.result}}<span>
                        </td>
                    </tr>
                    <tr ng-show="shirt.show_more">
                        <td>Biceps</td>
                        <td>
                            <span>{{shirt.area.biceps.result.result}}<span>
                        </td>
                    </tr>
                    <tr ng-show="shirt.show_more">
                        <td>Wrist</td>
                        <td>
                             <span>{{shirt.area.wrist.result.result}}<span>
                        </td>
                    </tr>                                                    
                    <tr ng-show="shirt.show_more">
                        <td colspan="2" ng-click="shirt.show_more = !shirt.show_more">
                            Show less
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </my-pane>
     </my-tabs>

地区
分数
项圈
{{shirt.area.collar.result.result}
袖子
{{衬衫.面积.半肩袖.结果.结果}
胸膛
{{shirt.area.collar.result.result}
显示更多
腰围
{{衬衫.面积.腰围.结果.结果}
臀部
{{shirt.area.hips.result.result}
长度
{{shirt.area.length.result.result}
肩
{{衬衫.面积.肩部.结果.结果}
肱二头肌
{{shirt.area.biceps.result.result}
手腕
{{衬衫.面积.手腕.结果.结果}
少展示

您也可以提供您的部分吗?我不知道清除选项卡标题意味着什么。所以不清楚你在问什么。另外,您同时使用
窗格。建议=='true'
窗格。建议===true
在您的代码中,我建议只使用
===
。很抱歉我的问题不清楚。因此,当我点击一个按钮时,它会将例如3组值加载到my tabs视图中。因此,选项卡将有3个选项卡标题。当我单击out并重新加载另一组值时,3个选项卡标题将不会被清除,但前3组的内容将被清除。请在plunker中创建演示。当控制台可用时更容易提供帮助