Closed
Description
I am working with the library for the first time, configuring it doesn't seem to be working. I have setup the the library to work with angular, and configuration are as below:
but getting below error:
$('#builder').queryBuilder({
filters: [
{
id: 'name',
label: 'Name',
type: 'string'
},
{
id: 'in_stock',
label: 'In stock',
type: 'integer',
input: 'radio',
values: {
1: 'Yes',
0: 'No'
},
operators: ['equal']
},
{
id: 'price',
label: 'Price',
type: 'double',
validation: {
min: 0,
step: 0.01
}
},
{
id: 'id',
label: 'Identifier',
type: 'string',
placeholder: '____-____-____',
operators: ['equal', 'not_equal'],
validation: {
format: /^.{4}-.{4}-.{4}$/
}
}
],
rules: {
condition: 'AND',
rules: [
{
id: 'price',
operator: 'less',
value: 10.25
},
{
condition: 'OR',
rules: [
{
id: 'category',
operator: 'equal',
value: 2
},
{
id: 'category',
operator: 'equal',
value: 1
}
]
}
]
}
});
But i get the below error
TypeError: Cannot read property 'template' of undefined
at QueryBuilder.
at Array.forEach (native)
I tried bypassing it by providing templates: []
, but that leads to another error as below:
TypeError: this.templates.group is not a function
at QueryBuilder.getGroupTemplate (vendor.bundle.js:127034)
at QueryBuilder.setRoot (vendor.bundle.js:125226)
at QueryBuilder.setRules (vendor.bundle.js:126177)
at new QueryBuilder
Can you please point me to the right direction.