fix(compiler): remove style when [style.foo]='exp' evaluates to null

Fixes #5110

Closes #5114
This commit is contained in:
Pawel Kozlowski
2015-11-04 10:16:47 +01:00
parent a69e7fe297
commit f1989e7e1c
2 changed files with 26 additions and 1 deletions

View File

@ -162,7 +162,8 @@ export class AppView implements ChangeDispatcher, RenderEventDispatcher {
this.renderer.setElementClass(elementRef, b.name, currentValue);
} else if (b.isElementStyle()) {
var unit = isPresent(b.unit) ? b.unit : '';
this.renderer.setElementStyle(elementRef, b.name, `${currentValue}${unit}`);
this.renderer.setElementStyle(elementRef, b.name,
isPresent(currentValue) ? `${currentValue}${unit}` : null);
} else {
throw new BaseException('Unsupported directive record');
}