有沒有人有建議我應該爲Angular2應用程序記錄我的TypeScript代碼?我正在尋找一個可以從文檔代碼生成文檔頁面的工具。Documenting Angular2 TypeScript代碼
我試着用TypeDoc做,但它似乎並沒有工作到目前爲止,並給我很多錯誤。
如果有人有這方面的經驗,任何建議將有所幫助。
更新:
我一直在試圖用TypeDoc生成文檔。 這是我運行命令:
typedoc --experimentalDecorators --out 'doc/' 'app/' --excludeExternals --target 'es5' -module 'commonjs'
這裏就是我得到:
Using TypeScript 1.8.10 from /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/typescript/lib
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(17)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(20)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(21)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/attributedirectives/slide-ng-if.directive.ts(22)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(88)
Cannot find name 'IGridstackOptions'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(107)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(109)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/dashboard.component.ts(115)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/goalwidget.component.ts(3)
Module '"/Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/models/goal"' has no exported member 'Unit'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(2)
Cannot find namespace 'moment'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(54)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(55)
Cannot find name 'Chart'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/dashboard/widgets/risk-score-widget.component.ts(72)
Cannot find name 'moment'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(36)
Cannot find name 'IGridstackOptions'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(56)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/gridstack/gridstack.component.ts(58)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/navigation/sidebarmenu.component.ts(80)
Property 'startsWith' does not exist on type 'string'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/components/user/role-selector.component.ts(34)
Cannot find name 'jQuery'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/pipes/display-notation.pipe.ts(2)
Module '"/Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/models/goal"' has no exported member 'Unit'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/pipes/moment.pipe.ts(5)
Cannot find name 'moment'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/services/implementations/mock/mock-score-service.ts(2)
Cannot find namespace 'moment'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/services/implementations/mock/mock-score-service.ts(14)
Cannot find name 'moment'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/util/mobileDetector.ts(3)
Cannot find name 'MobileDetect'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/app/util/mobileDetector.ts(6)
Cannot find name 'MobileDetect'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/platform/browser.d.ts(77)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(38)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(92)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/application_ref.d.ts(151)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(22)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.d.ts(24)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/di/reflective_provider.d.ts(102)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/di/reflective_provider.d.ts(102)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/component_resolver.d.ts(7)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/component_resolver.d.ts(11)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(58)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(99)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(104)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/core/linker/dynamic_component_loader.d.ts(105)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/async.d.ts(26)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/async.d.ts(27)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(0)
Cannot find name 'MapConstructor'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(1)
Cannot find name 'SetConstructor'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(3)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(3)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(6)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(7)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(10)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(11)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(13)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(14)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(99)
Cannot find name 'Set'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(100)
Cannot find name 'Set'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/collection.d.ts(101)
Cannot find name 'Set'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(3)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(4)
Cannot find name 'Set'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/lang.d.ts(70)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(1)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(7)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(8)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(9)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(9)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(10)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(10)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(11)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(11)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/facade/promise.d.ts(12)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/platform/browser/browser_adapter.d.ts(74)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/platform/dom/dom_adapter.d.ts(84)
Cannot find name 'Map'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(26)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(32)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(37)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(46)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/directives/router_outlet.d.ts(57)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(123)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(147)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(163)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/instruction.d.ts(166)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(20)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(38)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(56)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(79)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/interfaces.d.ts(101)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/lifecycle/lifecycle_annotations.d.ts(28)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_config/route_config_impl.d.ts(100)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_definition.d.ts(19)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_definition.d.ts(34)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/route_registry.d.ts(51)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(55)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(67)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(85)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(98)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(106)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(111)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(119)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(127)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(131)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(137)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/angular2/src/router/router.d.ts(145)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(34)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(49)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(88)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(93)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/CoreOperators.d.ts(93)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(45)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(46)
Cannot find name 'Iterator'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(102)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(102)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(142)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(157)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(200)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(205)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/Observable.d.ts(205)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/ForkJoinObservable.d.ts(5)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/ForkJoinObservable.d.ts(6)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/FromObservable.d.ts(6)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/FromObservable.d.ts(6)
Cannot find name 'Iterator'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/PromiseObservable.d.ts(8)
Cannot find name 'Promise'.
Error: /Users/bertwillekens/Desktop/dashboard/src/main/webapp/WEB-INF/node_modules/rxjs/observable/PromiseObservable.d.ts(9)
Cannot find name 'Promise'.
我已經更新了一些更詳細的職位。謝謝! –
你可以先用includeDeclarations來嘗試,如果它不起作用,那麼檢查ignoreCompilerErrors是否有效,至少是有一些輸出。 –
ignoreCompilerErrors更改了某些內容,現在生成了docs,但除了名爲Globals的空子部分外,它們是空的。 includeDeclarations似乎沒有任何效果。 –