angular/dgeni-packages

Support "import x as y"

chalin opened this issue · 7 comments

Line 17 of router-deprecated/src/lifecycle/lifecycle_annotations.ts is:

import {CanActivate as CanActivateAnnotation} ...

but when generating the API docs CanActivateAnnotation gets reported as an invalid:

Invalid link (does not match any doc): "RouteConfigAnnotation" - doc "@angular/router-deprecated/index/RouteConfig" (decorator)  - from file "/Users/chalin/git/angular/modules/@angular/router-deprecated/src/route_config/route_config_decorator.ts"

This can be confirmed from the corresponding API page: notice how the link to CanActivateAnnotation is invalid.

I believe that the actual problem here is that the type is not being exported publicly.
The following PR removes the problem: angular/angular#9909

I fixed a similar problem late yesterday (angular/angular#9899), but it didn't occur to me that it might be a similar fix for this problem. Thanks for looking into it. I'm marking this as resolved.

Upon closer inspection, I don't believe that angular/angular#9909 is a proper solution because CanActivateAnnotation is meant to remain private (it is only used as part of the initialization of the var).

In which case we should not be linking to it then. Part of the reworking of decorator docs that needs to be done...

angular/angular#9912 is a simple refactoring workaround that can be used until the decorator doc processing is fixed.

Is this still a problem @chalin ?

No, thanks.