Closed donajoshy closed 6 years ago
i added this code but child not working according to the parent id
Could you provide me your code?
public group1 = [ CreateNewAutocompleteGroup( 'Search / choose in / from list', 'completer_one', [ { title: 'Option 1', id: '1', children: [ {title: 'Option 1', id: '1'}, {title: 'Option 2', id: '2'} ] }, { title: 'Option 2', id: '2', children: [ {title: 'Option 3', id: '3'}, {title: 'Option 4', id: '4'} ] }, { title: 'Option 3', id: '3', children: [ {title: 'Option 5', id: '5'}, {title: 'Option 6', id: '6'} ] }, ], {titleKey: 'title', childrenKey: 'children'}, '' ), CreateNewAutocompleteGroup( 'Search / choose in / from list', 'completer_two', [ {title: 'Option 1', id: '1'}, {title: 'Option 2', id: '2'}, {title: 'Option 3', id: '3'}, {title: 'Option 4', id: '4'}, {title: 'Option 5', id: '5'}, {title: 'Option 6', id: '6'}, ], {titleKey: 'title', childrenKey: null}, 'completer_one' ) ];
after selecting one from parent, not get the value corresponding to parent id
It should be setting the children it has. And also emitting the chosen value. Could you provide me with console.log's?
NgAutocompleteComponent.html:3 ERROR TypeError: Cannot read property 'titleKey' of undefined
at ng-autocomplete.component.ts:123
at Array.forEach (
Please add the code for parent child example