Skip to content

Commit 767096d

Browse files
committed
Clean up of comments and logs
1 parent 83329c3 commit 767096d

File tree

3 files changed

+2
-55
lines changed

3 files changed

+2
-55
lines changed

src/directives/decorators/bootstrap/bootstrap-decorator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(de
77
/*fieldset: {template: base + 'fieldset.html', replace: true, builder: function(args) {
88
var children = args.build(args.form.items, args.path + '.items');
99
console.log('fieldset children frag', children.childNodes)
10-
args.fieldFrag.appendChild(children);
10+
args.fieldFrag.childNode.appendChild(children);
1111
}},*/
1212
array: {template: base + 'array.html', replace: false},
1313
tabarray: {template: base + 'tabarray.html', replace: false},

src/directives/field.js

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ angular.module('schemaForm').directive('sfField',
1111
scope: true,
1212
require: '?^sfSchema',
1313
link: {
14-
pre: function(scope, element, attrs, sfSchema) {
14+
pre: function(scope) {
1515
//The ngModelController is used in some templates and
1616
//is needed for error messages,
1717
scope.$on('schemaFormPropagateNgModelController', function(event, ngModel) {
@@ -140,64 +140,12 @@ angular.module('schemaForm').directive('sfField',
140140
// Rebind our part of the form to the scope.
141141
var once = scope.$watch(attrs.sfField, function(form) {
142142
if (form) {
143-
console.warn('got form!!!!', form)
144143
// Workaround for 'updateOn' error from ngModelOptions
145144
// see https://github.com/Textalk/angular-schema-form/issues/255
146145
// and https://github.com/Textalk/angular-schema-form/issues/206
147146
form.ngModelOptions = form.ngModelOptions || {};
148147
scope.form = form;
149148

150-
/*
151-
//ok let's replace that template!
152-
//We do this manually since we need to bind ng-model properly and also
153-
//for fieldsets to recurse properly.
154-
var templatePromise;
155-
156-
// type: "template" is a special case. It can contain a template inline or an url.
157-
// otherwise we find out the url to the template and load them.
158-
if (form.type === 'template' && form.template) {
159-
templatePromise = $q.when(form.template);
160-
} else {
161-
var url = form.type === 'template' ? form.templateUrl : templateUrl(name, form);
162-
templatePromise = $http.get(url, {cache: $templateCache}).then(function(res) {
163-
return res.data;
164-
});
165-
}
166-
*/
167-
/*
168-
templatePromise.then(function(template) {
169-
if (form.key) {
170-
var key = form.key ?
171-
sfPathProvider.stringify(form.key).replace(/"/g, '"') : '';
172-
template = template.replace(
173-
/\$\$value\$\$/g,
174-
'model' + (key[0] !== '[' ? '.' : '') + key
175-
);
176-
}
177-
element.html(template);
178-
*/
179-
// Do we have a condition? Then we slap on an ng-if on all children,
180-
// but be nice to existing ng-if.
181-
/*if (form.condition) {
182-
183-
var evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex})';
184-
if (form.key) {
185-
evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model' + sfPath.stringify(form.key) + '})';
186-
}
187-
188-
angular.forEach(element.children(), function(child) {
189-
var ngIf = child.getAttribute('ng-if');
190-
child.setAttribute(
191-
'ng-if',
192-
ngIf ?
193-
'(' + ngIf +
194-
') || (' + evalExpr +')'
195-
: evalExpr
196-
);
197-
});
198-
}*/
199-
//$compile(element.contents())(scope);
200-
//});
201149

202150
// Where there is a key there is probably a ngModel
203151
if (form.key) {

src/services/decorators.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ angular.module('schemaForm').provider('schemaFormDecorators',
280280
var type = (form.schema && form.schema.type) || '';
281281

282282
// Empty means '',{} and [] for appropriate types and undefined for the rest
283-
//console.log('destroy', destroyStrategy, form.key, type, obj);
284283
if (destroyStrategy === 'empty' && type.indexOf('string') !== -1) {
285284
obj[form.key.slice(-1)] = '';
286285
} else if (destroyStrategy === 'empty' && type.indexOf('object') !== -1) {

0 commit comments

Comments
 (0)