From d4ffa47ea6908b5f09db23bf95bcbce93dd0b0ed Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 7 Feb 2017 08:04:25 +0000 Subject: [PATCH] fix(aio): correctly render decorator docs (#14328) This commit updates the doc-gen to account for the changes to the codebase for decorators. There are actually three kinds of calls that create decorators: * makeDecorator * makePropDecorator * makeParamDecorator Also, the actual documentation for each decorator is split between two exported symbols: * `interface [DecoratorName]` contains the metadata fields * interface [DecoratorName]Decorator` contains a "call member" which holds the general description of the decorator. This processor now identifies all three decorator types, and pulls the description of the callMember onto the main decorator doc description. (There are some outstanding interfaces in the angular/angular project that need to be re-exported from `/angular/modules/@angular/core/src/metadata.ts` to ensure that the doc-gen is able to access them.) Closes https://github.com/angular/angular.io/pull/2349 --- docs/templates/includes/_metadata.html | 4 +- .../processors/mergeDecoratorDocs.js | 66 ++++++++----------- .../processors/mergeDecoratorDocs.spec.js | 18 ++--- 3 files changed, 35 insertions(+), 53 deletions(-) diff --git a/docs/templates/includes/_metadata.html b/docs/templates/includes/_metadata.html index f9c7e3abc1..5bca45a8e7 100644 --- a/docs/templates/includes/_metadata.html +++ b/docs/templates/includes/_metadata.html @@ -1,8 +1,8 @@ -{% if doc.metadataDoc and doc.metadataDoc.members.length %} +{% if doc.members.length %}

Metadata Properties

- {% for metadata in doc.metadataDoc.members %}{% if not metadata.internal %} + {% for metadata in doc.members %}{% if not metadata.internal %}