Skip to content

fix(autocomplete): throw better error when autocomplete doesn't have a panel #4851

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

Merged

Conversation

crisbeto
Copy link
Member

Adds a more informative error if the user tries to open an autocomplete that doesn't exist or hasn't been defined yet by the @ViewChild query.

Fixes #4844.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 28, 2017
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one typo to fix. Apply merge label when ready.

@@ -1156,6 +1161,15 @@ describe('MdAutocomplete', () => {
expect(fixture.componentInstance.mdOptions.length).toBe(2);
}));

it('should not throw if the user attempts to open the panel too early', async(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test name seems to be backwards. It should throw the error, right?

@kara kara assigned crisbeto and unassigned kara May 30, 2017
@kara kara added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review action: merge The PR is ready for merge by the caretaker labels May 30, 2017
…a panel

Adds a more informative error if the user tries to open an autocomplete that doesn't exist or hasn't been defined yet by the `@ViewChild` query.

Fixes angular#4844.
@crisbeto crisbeto force-pushed the 4844/autocomplete-better-error branch from 636b980 to e8ce88f Compare May 31, 2017 17:19
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label May 31, 2017
@andrewseguin andrewseguin merged commit 70b31f1 into angular:master Jun 5, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MdAutocomplete Throws error on dynamic focus
4 participants