Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

+ Add class to label #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ NOTE: All of these properties will be under the `templateOptions` property as of
###### Default
>`undefined`

---
##### labelClass (string)
>`labelClass` is used to add classes to the label.

###### Default
>`undefined`

---
##### labelSrOnly (boolean)
>`labelSrOnly` is used to add the sr-only class to a label so it will hide on non-screen-readers
Expand Down
1 change: 1 addition & 0 deletions src/wrappers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default ngModule => {
apiCheck: check => ({
templateOptions: {
label: check.string.optional,
labelClass: check.string.optional,
required: check.bool.optional,
labelSrOnly: check.bool.optional,
}
Expand Down
2 changes: 1 addition & 1 deletion src/wrappers/label.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<label for="{{id}}" class="control-label {{to.labelSrOnly ? 'sr-only' : ''}}" ng-if="to.label">
<label for="{{id}}" class="control-label {{to.labelClass}} {{to.labelSrOnly ? 'sr-only' : ''}}" ng-if="to.label">
{{to.label}}
{{to.required ? '*' : ''}}
</label>
Expand Down