Angular js:指令手风琴按钮

时间:2018-02-23 09:09:25

标签: angularjs asp.net-mvc-4

我无法使用Angular js在手风琴中将标题放在标题之后,我怎么能在我的模板指令中这样做:请你有个想法。

css:

.StyleButton {
    float : left !important;
    color: @mBlueLight !important;
    background-color: @mWhite;
    padding-left : 10px;
    padding-right :10px;
    margin-top :-3px;
    margin-right :10px;
    &:hover{
        color:@mWhite;
    }
}

.directive('spotcam', function () {
    return {
        restrict: 'EA',
        replace: true,
        transclude: true,
        require: '^accordion',
        scope: { title: '@' },
        template: '<div>' + 
                  ' <div class="title" ng-class="{true: \'selectedAccordionStyle\',false:\'\'}[showMe]"> <a class="more-less glyphicon glyphicon-plus" ng-class="{true: \'glyphicon glyphicon-minus\', false:\'glyphicon glyphicon-plus\'}[showMe]" data-ng-click="toggle()"></a>  {{title}} <button class="StyleButton"> Valider la saisie</button> </div>' +
                   '<div class="body" data-ng-show="showMe" data-ng-transclude=""></div>' +
                   '</div>',
        link: function (scope, element, attrs, accordionController) {
            scope.showMe = false;
            accordionController.addSpot(scope);
            scope.toggle = function () {
                scope.showMe = !scope.showMe;
                accordionController.Open(scope);
            };
        }
    }
});

0 个答案:

没有答案