From c797a4fbd52e8d72d1b77a7480e24b078d33c37c Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Sat, 24 Jan 2015 13:12:12 +0100 Subject: [PATCH] refactor(LightDom): refactor the code --- .../src/compiler/shadow_dom_emulation/light_dom.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/core/src/compiler/shadow_dom_emulation/light_dom.js b/modules/core/src/compiler/shadow_dom_emulation/light_dom.js index cdf0e7ea22..5f9582f8cf 100644 --- a/modules/core/src/compiler/shadow_dom_emulation/light_dom.js +++ b/modules/core/src/compiler/shadow_dom_emulation/light_dom.js @@ -38,7 +38,7 @@ export class LightDom { redistribute() { var tags = this.contentTags(); - if (isPresent(tags)) { + if (tags.length > 0) { redistributeNodes(tags, this.expandedDomNodes()); } } @@ -47,8 +47,8 @@ export class LightDom { return this._collectAllContentTags(this.shadowDomView, []); } - _collectAllContentTags(item, acc:List):List { - var eis = item.elementInjectors; + _collectAllContentTags(view: View, acc:List):List { + var eis = view.elementInjectors; for (var i = 0; i < eis.length; ++i) { var ei = eis[i]; if (isBlank(ei)) continue; @@ -58,8 +58,8 @@ export class LightDom { } else if (ei.hasPreBuiltObject(ViewPort)) { var vp = ei.get(ViewPort); - ListWrapper.forEach(vp.contentTagContainers(), (c) => { - this._collectAllContentTags(c, acc); + ListWrapper.forEach(vp.contentTagContainers(), (view) => { + this._collectAllContentTags(view, acc); }); } }