Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chips/Autocomplete Lazy Load of Suggested Items #252

Closed
crain opened this issue Jan 13, 2017 · 4 comments
Closed

Chips/Autocomplete Lazy Load of Suggested Items #252

crain opened this issue Jan 13, 2017 · 4 comments

Comments

@crain
Copy link

crain commented Jan 13, 2017

Feature Request

Add the possibility to lazy load suggested items for the chips/autocomplete component.

https://teradata.github.io/covalent/#/components/chips

What is the motivation / use case for changing the behavior?

Currently the component needs all data beforehand and there is no possibilty to hook in to user inputs and refetch data based on the input.

Possible use case:
User Form where the user has to select multiple items out of a large dataset.
The data can't be loaded before as the browser memory would blow up.

@richavyas richavyas self-assigned this Jan 13, 2017
@emoralesb05
Copy link
Contributor

So, we need to externalize the inputs events somehow... now, with the way md-autocomplete will work in @angular/material, this might change a little bit so lets start by discussing things in this issue.

@emoralesb05
Copy link
Contributor

I think that we can create a method to get to the input element:

e.g.

@ViewChild(TdChipsComponent) chips: TdChipsComponent;

ngOnInit(): void {
  this.chips.getInputElement().onChange((event) => {
    // do your loading here
  });
}

OR

<td-chips #chips (keydown)="loadItems(chips.getInputElement().value)">
</td-chips>

That way people can get to the internal element and its event hooks without having to create n number of EventEmitters.

Although, its nice if we can at least handle 2 or 3 general events.

<td-chips (inputChange)="loadItems($event)">
</td-chips>

And so, just thinking out loud.

Which we might have to start creating methods to access the underlying component for most implementations either way, since there are cases where you want that.

@emoralesb05
Copy link
Contributor

This PR #459 will be the base for this feature.

@emoralesb05
Copy link
Contributor

#626 will take care of this 😄 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants