简体   繁体   English

用generator-ngdoc生成gulp-angular文档

[英]generating gulp-angular documentation with generator-ngdoc

I am having a hard time generating documentation for my gulp-angular based project: I am using this generator to generate a docs folder inside of my project: generator-ngdoc (dgeni based). 我很难为基于gulp-angular的项目生成文档:我正在使用此生成器在项目内部生成一个docs文件夹: generator-ngdoc (基于dgeni)。 Whenever I open the documentation for a component I am getting this error. 每当我打开某个组件的文档时,都会出现此错误。

angular.js:68 Uncaught Error: [$injector:nomod] Module 'appModule' is 
not available! You either misspelled the module name or forgot to load 
it. If registering a module ensure that you specify the dependencies 
as the second argument.
http://errors.angularjs.org/1.5.9/$injector/nomod?p0=appModule
  at angular.js:68
  at angular.js:2127
  at ensure (angular.js:2051)
  at Object.module (angular.js:2125)
  at modules.js:5
  at modules.js:20

in modules.js there is the following code: modules.js有以下代码:

(function () {
  'use strict';

  angular
    .module('appModule')
    .config(config);

  config.$inject = ['$logProvider', 'ngToastProvider'];

  function config($logProvider, ngToastProvider) {
    // Enable log
    $logProvider.debugEnabled(true);
    ngToastProvider.configure({
      animation: 'slide',// or 'fade'
      verticalPosition: 'bottom',
      horizontalPosition: 'left'
    });
  }

})();

/* global moment:false */
(function() {
  'use strict';
  angular
    .module('appModule')
    .constant('moment', moment);

})();

/**
 *
 * @ngdoc module
 * @name appModule
 * @module appModule
 * @packageName agirc-arrco
 * @description
 * This is a sample module.
 *
 **/
(function () {
  'use strict';

  angular
    .module('appModule', ['ngAnimate', 'ngCookies', 'ngTouch', 
'ngSanitize', 'ngMessages', 'ngAria', 'ngResource', 'ui.router', 
'ui.bootstrap', 'agr.components.stepper', 'agr.components.toggle',
  'agr.components.accordionrow', 'angularMoment', 
'agr.components.header', 'agr.filters.period', 'agr.directives.limit- 
 to', 'env.config']);

  })();

I am not sure but is seems that dgeni is including the module config before the module declaration itself. 我不确定,但似乎dgeni在模块声明本身之前包括了模块配置。 any solution for that ? 有什么解决办法吗?

我找到了解决方案:模块文件应单独添加到gulp.src任务中的gulp.src gulp/module.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM