答案 0 :(得分:1)
以下是解决方案:http://jsbin.com/miroge/edit?html,js,output
问题是你用两个对象调用setType
,而不是两个对象的数组。你在做什么:
formlyConfigProvider.setType({
name: 'multi-checkbox',
templateUrl: 'multi-checkbox-template.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
},{
name: 'well-multi-checkbox',
templateUrl: 'well-multi-checkbox-template.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
});
你应该做什么:
formlyConfigProvider.setType([{
name: 'multi-checkbox',
templateUrl: 'multi-checkbox-template.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
},{
name: 'well-multi-checkbox',
templateUrl: 'well-multi-checkbox-template.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
}]);