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

Commit 7ce7baa

Browse files
author
Kent C. Dodds
committed
grunt build
1 parent 1e633e7 commit 7ce7baa

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

dist/formly.js

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,41 @@ angular.module('formly.render').directive('formlyField', [
8080
}
8181
]);
8282
'use strict';
83-
angular.module('formly.render').directive('formlyForm', function formlyForm() {
84-
return {
85-
restrict: 'AE',
86-
templateUrl: 'directives/formly-form.html',
87-
replace: true,
88-
scope: {
89-
fields: '=fields',
90-
options: '=options',
91-
result: '=result',
92-
formOnParentScope: '=name'
93-
},
94-
compile: function (scope, iElement, iAttrs, controller, transcludeFn) {
95-
return {
96-
post: function (scope, ele, attr, controller) {
97-
//Post gets called after angular has created the FormController
98-
//Now pass the FormController back up to the parent scope
99-
scope.formOnParentScope = scope[attr.name];
100-
}
101-
};
102-
}
103-
};
104-
});
83+
angular.module('formly.render').directive('formlyForm', [
84+
'$parse',
85+
function formlyForm($parse) {
86+
return {
87+
restrict: 'AE',
88+
templateUrl: 'directives/formly-form.html',
89+
replace: true,
90+
scope: {
91+
fields: '=fields',
92+
options: '=options',
93+
result: '=result',
94+
formOnParentScope: '=name'
95+
},
96+
compile: function (scope, iElement, iAttrs, controller, transcludeFn) {
97+
return {
98+
post: function (scope, ele, attr, controller) {
99+
//Post gets called after angular has created the FormController
100+
//Now pass the FormController back up to the parent scope
101+
scope.formOnParentScope = scope[attr.name];
102+
angular.forEach(scope.fields, function (field) {
103+
if (field.hideExpression) {
104+
var getter = $parse(field.hideExpression);
105+
scope.$watch(function () {
106+
return getter(scope.result);
107+
}, function (hide) {
108+
field.hide = hide;
109+
});
110+
}
111+
});
112+
}
113+
};
114+
}
115+
};
116+
}
117+
]);
105118
angular.module('formly.render').run([
106119
'$templateCache',
107120
function ($templateCache) {

dist/formly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formly.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)