formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.23k stars 405 forks source link

overwriteOk doesn't work #632

Open alexey-sh opened 8 years ago

alexey-sh commented 8 years ago

formly version 7.3.9 formly bootstrap version 6.2.0

strange...

my source code

angular
    .module('module')
.config(function(formlyConfigProvider) {

        formlyConfigProvider.setWrapper({
            name: 'horizontalBootstrapLabel',
            overwriteOk: true,
            template: [
                ''
            ].join(' ')
        });
});

console output

formly.js:825 Formly Warning: Attempting to overwrite horizontalBootstrapLabel on templateWrappers which is currently {"name":"horizontalBootstrapLabel","template":"","types":[]} with {"name":"horizontalBootstrapLabel","template":"<div class=\"row\"> <label for=\"{{::id}}\" class=\"{{to.bootstrapLabelClass}} control-label\"> {{to.label}} {{to.required ? \"*\" : \"\"}} </label> <div class=\"{{to.bootstrapTextClass}}\"> <formly-transclude></formly-transclude> </div> <div data-ng-if=\"to.bootstrapHelpClass\" class=\"{{to.bootstrapHelpClass}}\" data-ng-bind-html=\"to.helperLink\"> </div> </div>","types":[]} To supress this warning, specify the property "overwriteOk: true" https://github.com/formly-js/angular-formly/blob/7.3.9/other/ERRORS_AND_WARNINGS.md#overwriting-types-or-wrappers

well.. what i'm doing wrong? Thanks

kentcdodds commented 8 years ago

Could you please reproduce your issue using issue.angular-formly.com? It will help us determine what exactly the problem is that you're describing and how it could be fixed. Thanks!

mikecfisher commented 7 years ago

I can confirm I'm having this exact same issue with this version of formly when running my tests via karma I get this error hundreds of times. Similar to this stack overflow issue: http://stackoverflow.com/questions/42844904/get-rid-of-formly-warnings-in-karma-output