@@ -564,7 +564,6 @@ angular.module('schemaForm').provider('schemaFormDecorators',
564564 var type = ( form . schema && form . schema . type ) || '' ;
565565
566566 // Empty means '',{} and [] for appropriate types and undefined for the rest
567- //console.log('destroy', destroyStrategy, form.key, type, obj);
568567 if ( destroyStrategy === 'empty' && type . indexOf ( 'string' ) !== - 1 ) {
569568 obj [ form . key . slice ( - 1 ) ] = '' ;
570569 } else if ( destroyStrategy === 'empty' && type . indexOf ( 'object' ) !== - 1 ) {
@@ -1727,7 +1726,7 @@ angular.module('schemaForm').directive('sfField',
17271726 scope : true ,
17281727 require : '?^sfSchema' ,
17291728 link : {
1730- pre : function ( scope , element , attrs , sfSchema ) {
1729+ pre : function ( scope ) {
17311730 //The ngModelController is used in some templates and
17321731 //is needed for error messages,
17331732 scope . $on ( 'schemaFormPropagateNgModelController' , function ( event , ngModel ) {
@@ -1856,64 +1855,12 @@ angular.module('schemaForm').directive('sfField',
18561855 // Rebind our part of the form to the scope.
18571856 var once = scope . $watch ( attrs . sfField , function ( form ) {
18581857 if ( form ) {
1859- console . warn ( 'got form!!!!' , form )
18601858 // Workaround for 'updateOn' error from ngModelOptions
18611859 // see https://github.com/Textalk/angular-schema-form/issues/255
18621860 // and https://github.com/Textalk/angular-schema-form/issues/206
18631861 form . ngModelOptions = form . ngModelOptions || { } ;
18641862 scope . form = form ;
18651863
1866- /*
1867- //ok let's replace that template!
1868- //We do this manually since we need to bind ng-model properly and also
1869- //for fieldsets to recurse properly.
1870- var templatePromise;
1871-
1872- // type: "template" is a special case. It can contain a template inline or an url.
1873- // otherwise we find out the url to the template and load them.
1874- if (form.type === 'template' && form.template) {
1875- templatePromise = $q.when(form.template);
1876- } else {
1877- var url = form.type === 'template' ? form.templateUrl : templateUrl(name, form);
1878- templatePromise = $http.get(url, {cache: $templateCache}).then(function(res) {
1879- return res.data;
1880- });
1881- }
1882- */
1883- /*
1884- templatePromise.then(function(template) {
1885- if (form.key) {
1886- var key = form.key ?
1887- sfPathProvider.stringify(form.key).replace(/"/g, '"') : '';
1888- template = template.replace(
1889- /\$\$value\$\$/g,
1890- 'model' + (key[0] !== '[' ? '.' : '') + key
1891- );
1892- }
1893- element.html(template);
1894- */
1895- // Do we have a condition? Then we slap on an ng-if on all children,
1896- // but be nice to existing ng-if.
1897- /*if (form.condition) {
1898-
1899- var evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex})';
1900- if (form.key) {
1901- evalExpr = 'evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model' + sfPath.stringify(form.key) + '})';
1902- }
1903-
1904- angular.forEach(element.children(), function(child) {
1905- var ngIf = child.getAttribute('ng-if');
1906- child.setAttribute(
1907- 'ng-if',
1908- ngIf ?
1909- '(' + ngIf +
1910- ') || (' + evalExpr +')'
1911- : evalExpr
1912- );
1913- });
1914- }*/
1915- //$compile(element.contents())(scope);
1916- //});
19171864
19181865 // Where there is a key there is probably a ngModel
19191866 if ( form . key ) {
0 commit comments