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
Renderer.setElementAttribute's attributeValue parameter and strictNullChecks #13686
Comments
Duplicate of #11844 |
Closing as a duplicate of #11844, thnx @DzmitryShylovich |
Manduro
added a commit
to Manduro/angular
that referenced
this issue
May 27, 2017
Using Renderer’s setElementAttribute or setElementStyle with a null or undefined value removes the corresponding attribute or style. The argument type should allow this when using strictNullChecks. Closes angular#13686
3 tasks
mhevery
pushed a commit
to Manduro/angular
that referenced
this issue
Jul 26, 2017
Using Renderer’s setElementAttribute or setElementStyle with a null or undefined value removes the corresponding attribute or style. The argument type should allow this when using strictNullChecks. Closes angular#13686
mhevery
pushed a commit
to Manduro/angular
that referenced
this issue
Oct 12, 2018
Using Renderer’s setElementAttribute or setElementStyle with a null or undefined value removes the corresponding attribute or style. The argument type should allow this when using strictNullChecks. Closes angular#13686
mhevery
pushed a commit
that referenced
this issue
Oct 12, 2018
FrederikSchlemmer
pushed a commit
to FrederikSchlemmer/angular
that referenced
this issue
Jan 3, 2019
Using Renderer’s setElementAttribute or setElementStyle with a null or undefined value removes the corresponding attribute or style. The argument type should allow this when using strictNullChecks. Closes angular#13686 PR Close angular#17065
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a ... (check one with "x")
Current behavior
This is more a stylistic thing, but
is a legal usage as it deletes data-some-param attribute from element, but this code shows typescript error when using strictNullChecks because setElementAttribute is described as:
attributeValue is just
string
and notstring | undefined
Expected behavior
attributeValue to have type
string | undefined
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
https://github.com/angular/angular/blob/master/modules/%40angular/core/src/render/api.ts
still the same in latest Angular
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: