You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binding a null value to a style property results in parsing errors only with Universal #35735
I assume either @angular/platform-server or Universal.
Is this a regression?
idk
Description
When using [style.color]="null", normal Angular will render that properly. That is, it will result in no style value at all. However, when using server-side rendering, it will result in style="color:;" which results in parsing errors.
Create a new Angular app. Add Universal to it. In a template, add this: <div [style.color]="null">text</div>. Start the Universal server (npm run dev:ssr). Run curl localhost:4200, see that the result is this: <div style="color:;">text</div>. However, if you run it in the browser the result will be just <div>text</div>.
The second (no style attribute) is the correct behavior and the server-side rendered version should mirror that. Not serve an empty color:; value.
🔥 Exception or Error
Error in parsing value for ‘color’. Declaration dropped.
Activity
petebacondarwin commentedon Oct 19, 2020
I cannot reproduce this with an app created from the latest Angular...
When I set the value to
nullthen no style is attached to the<div>:petebacondarwin commentedon Oct 19, 2020
I believe it was fixed by this change: 9bd9590#diff-fe6768f58e32d9fdc70a4aedceefdc19d4d7394ac3a6996e32b9590c508fe6c7R279 which first appears in 9.1.0.
angular-automatic-lock-bot commentedon Nov 19, 2020
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.