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
help(matBadge): Getting error Type 'number' is not assignable to type 'string' with strictTemplates flag #20326
Labels
area: material/badge
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
gauravsoni119
added
needs triage
This issue needs to be triaged by the team
troubleshooting
This issue is not reporting an issue, but just asking for help
labels
Aug 15, 2020
gauravsoni119
changed the title
help(matBadge): Getting error Type 'number' is not assignable to type 'string' with strictTemplates
help(matBadge): Getting error Type 'number' is not assignable to type 'string' with strictTemplates flag
Aug 15, 2020
crisbeto
added
area: material/badge
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
and removed
needs triage
This issue needs to be triaged by the team
troubleshooting
This issue is not reporting an issue, but just asking for help
labels
Aug 16, 2020
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Aug 16, 2020
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `any` with the option configure it through a generic parameter since we aren't actually doing anything with the value, apart from forwarding it. Fixes angular#20326.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Aug 17, 2020
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `any` with the option configure it through a generic parameter since we aren't actually doing anything with the value, apart from forwarding it. Fixes angular#20326.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Aug 17, 2020
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `string | number | undefined | null` since we aren't actually doing anything with the value, apart from forwarding it. Fixes angular#20326.
wagnermaciel
pushed a commit
that referenced
this issue
Aug 20, 2020
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `string | number | undefined | null` since we aren't actually doing anything with the value, apart from forwarding it. Fixes #20326.
wagnermaciel
pushed a commit
that referenced
this issue
Aug 20, 2020
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `string | number | undefined | null` since we aren't actually doing anything with the value, apart from forwarding it. Fixes #20326. (cherry picked from commit 75f73ae)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
wagnermaciel
pushed a commit
to wagnermaciel/components
that referenced
this issue
Jan 14, 2021
Currently the badge's content is limited to `string` which excludes other legitimate use cases like numbers. These changes turn it into an `string | number | undefined | null` since we aren't actually doing anything with the value, apart from forwarding it. Fixes angular#20326.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: material/badge
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
What are you trying to do?
I am using the
matBadge
directive and I need to pass some default value to the matBadge(for example 0, 7, etc). But as I enabled the strictTemplates flag in mytsconfig.json
, I am getting an errorType 'number' is not assignable to type 'string'
since the
@Input matBadge
is expecting a string.I can fix it by doing something like:-
@Input() badgeValue = '7';
and then pass it to
matBadge
directive, but I feel like this is annoying.Can anyone help me with this?
Environment
The text was updated successfully, but these errors were encountered: