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

Commit 0ffca14

Browse files
author
Kent C. Dodds
committed
Merge pull request #401 from DevanB/master
Added ability to add custom class to ngTransclude. Fixes #398.
2 parents 9fb755c + 8af8d1f commit 0ffca14

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/directives/formly-form.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol
5050
form-options="options"
5151
index="$index">
5252
</${fieldRootEl}>
53-
<div ng-transclude></div>
53+
<div ng-transclude class="${getTranscludeClass()}"></div>
5454
</${rootEl}>
5555
`;
5656

@@ -87,6 +87,10 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol
8787
return formName;
8888
}
8989

90+
function getTranscludeClass() {
91+
return attrs.transcludeClass || '';
92+
}
93+
9094
function copyAttributes(attributes) {
9195
const excluded = ['model', 'form', 'fields', 'options', 'name', 'role', 'class',
9296
'data-model', 'data-form', 'data-fields', 'data-options', 'data-name'];

src/directives/formly-form.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('formly-form', () => {
149149
expect(() => scope.$digest()).to.not.throw();
150150
});
151151

152-
describe.skip(`ngTransclude element`, () => {
152+
describe(`ngTransclude element`, () => {
153153
it(`should have the specified className`, () => {
154154
const el = compileAndDigest(`
155155
<formly-form model="model" fields="fields" form="theForm" transclude-class="foo yeah"></formly-form>

0 commit comments

Comments
 (0)