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

self.context.search is undefined #3

Open
ilosuna opened this issue Oct 6, 2016 · 1 comment
Open

self.context.search is undefined #3

ilosuna opened this issue Oct 6, 2016 · 1 comment

Comments

@ilosuna
Copy link

ilosuna commented Oct 6, 2016

Error in angular2-tutorial/04-expressions/src/app/app.component.ts:

EXCEPTION: Error in ./AppComponent class AppComponent - inline template:5:8 caused by: self.context.search is undefined

{{search.toUpperCase() + "!"}} should now be {{ search + "!" | uppercase }}. Not sure about search.length.

EDIT:
There must be a question mark after search: {{ search?.length || 0 }}

@KillerCodeMonkey
Copy link
Contributor

Do not know what you are trying, but we are initialising search as a string with a value, so this.search or {{search}} is defined in any case --> if you remove all chars in the input field the string is an empty string ... so no problems at all?

Maybe you can show us your complete component and template?

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

No branches or pull requests

2 participants