fix(common): ngStyle should ignore undefined values (#34422)

Prior to ivy, undefined values passed in an object to the
ngStyle directive were ignored. Restore this behavior by
ignoring keys that point to undefined values.

closes #34310

PR Close #34422
This commit is contained in:
Michael Nahkies
2019-12-16 10:17:47 +00:00
committed by Kara Erickson
parent 23cf11a788
commit 1144ce97f9
2 changed files with 27 additions and 1 deletions

View File

@ -214,7 +214,10 @@ function bulidMapFromValues(
let key = keys[i];
key = trim ? key.trim() : key;
const value = (values as{[key: string]: any})[key];
setMapValues(map, key, value, parseOutUnits, allowSubKeys);
if (value !== undefined) {
setMapValues(map, key, value, parseOutUnits, allowSubKeys);
}
}
} else {
// case 2: array