Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Create CollapseButton component class to standardize appearance of this button. #11462
Hmm, ideally, if we're modifying this directive, we would do the following:
- Make the directive an attribute or element directive rather than a class directive (probably making use of
transcludeor something to make sure we don't modify the content)
- Move the HTML into a template file and use something like
ng-classto control the class (instead of manually adding/removing classes whenever clicked)
Thoughts @cjcenizal? I understand this would take a bit more time to do, but I think it might be worth it in the end, since you're already modifying this directive.
@lukasolson You're right. I thought about it when I was working on this, too. But I think our sidebar will undergo some design and refactoring changes in the future, so I was thinking it'd be best to make the minimally invasive change now, and let this code get swept away during redesign or refactoring phases in the future.
Also, in terms of benefits, how much maintenance will this code require? If not that much, then will refactoring it now hold much benefit for people in the future?