From 26320160f96b99e039e73967887a3eed998b26be Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 3 Nov 2015 23:32:56 +0000 Subject: [PATCH] api-templates: only show directive inputs/outputs if there are some --- .../processors/matchUpDirectiveDecorators.js | 4 +++- .../templates/directive.template.html | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js b/public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js index 6424959e92..a5d2876142 100644 --- a/public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js +++ b/public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js @@ -61,5 +61,7 @@ function getDecoratorValues(classDecoratorValues, memberDecoratorName, members) } }); - return decoratorValues; + if (Object.keys(decoratorValues).length) { + return decoratorValues; + } } \ No newline at end of file diff --git a/public/api-builder/angular.io-package/templates/directive.template.html b/public/api-builder/angular.io-package/templates/directive.template.html index 23f28cd876..646841370a 100644 --- a/public/api-builder/angular.io-package/templates/directive.template.html +++ b/public/api-builder/angular.io-package/templates/directive.template.html @@ -11,11 +11,11 @@ code {$ selector $} {% endfor %} -{% if doc.inputs.length %} +{% if doc.inputs %} .l-main-section h2 Inputs - .l-sub-section - h3.input {% for binding, property in doc.inputs %} + .l-sub-section{% for binding, property in doc.inputs %} + h3.input code {$ property.bindingName | dashCase $} |  bound to  code {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $} @@ -24,11 +24,11 @@ {% endfor %} {% endif %} -{% if doc.ouputs.length %} +{% if doc.outputs %} .l-main-section h2 Outputs - .l-sub-section - h3.input {% for binding, property in doc.outputs %} + .l-sub-section{% for binding, property in doc.outputs %} + h3.output code {$ property.bindingName | dashCase $} |  bound to  code {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $}