diff --git a/ionic/components/button/button.ts b/ionic/components/button/button.ts index 7d7269069d..b6f5d038e5 100644 --- a/ionic/components/button/button.ts +++ b/ionic/components/button/button.ts @@ -28,20 +28,22 @@ export class Button { let nodes = []; for (let i = 0, l = childNodes.length; i < l; i++) { childNode = childNodes[i]; + if (childNode.nodeType === 3) { // text node if (childNode.textContent.trim() !== '') { nodes.push(TEXT); } - } else if (childNode.nodeName === 'ICON') { - // element node - nodes.push(ICON); - - } else { - // element other than an - nodes.push(TEXT); + } else if (childNode.nodeType === 1) { + if (childNode.nodeName === 'ICON') { + // icon element node + nodes.push(ICON); + } else { + // element other than an + nodes.push(TEXT); + } } }