Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Adding styles to Accordion #3038

Closed
nithyanv opened this issue Dec 2, 2014 · 2 comments
Closed

Adding styles to Accordion #3038

nithyanv opened this issue Dec 2, 2014 · 2 comments

Comments

@nithyanv
Copy link

nithyanv commented Dec 2, 2014

Hi,

I couldn't find any options to style Accordion. ngClass and ngStyle don't work. Am I missing something?

@OliPelz
Copy link

OliPelz commented Dec 2, 2014

Hi!
I have just stumbled over the very same problem.

For example I want to add a custom class for styling whenever something is true e.g.

<accordion>
    <accordion-group 
    heading="{{phenoGroup.phenoName}} ({{phenoGroup.countPhenos}})" 
    ng-repeat="phenoGroup in exp.phenotypeGroups" 
    ng-class="{phenoListHighlighted : pheno.isHighlighted}">
    Hello,hidden world
</accordion-group>
</accordion>

this is not possible, ng-class is completely ignored here!

@RobJacobs
Copy link
Contributor

@nithyanv @OliPelz You just need to wrap your accordion heading and content in another element (div) and use the ng-class on that. Something like so:

<accordion>
    <accordion-group ng-repeat="phenoGroup in exp.phenotypeGroups">
        <accordion-heading>
            <div ng-class="{phenoListHighlighted : pheno.isHighlighted}">
                {{phenoGroup.phenoName}} ({{phenoGroup.countPhenos}})
            </div>
        </accordion-heading>
        <div ng-class="{phenoListHighlighted : pheno.isHighlighted}">
            Hello,hidden world
        </div>
    </accordion-group>
</accordion>

Closing this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants