angularjs ngdocs 使用grunt生成api文档说明

来源:互联网 发布:seo技术学习 编辑:程序博客网 时间:2024/05/22 06:19

ngdocs的安装说明:

1.先下载这个包
在命令行执行:npm install grunt-ngdocs --save-dev

2.在gruntfile.js 里面加入这个任务
grunt.loadNpmTasks('grunt-ngdocs');

3.在gruntfile.js 文件中的grunt.initConfig()接口加入配置信息如下:

ngdocs: {
            options: {
                dest: 'docs',
                html5Mode: false,
                scripts: [
                 'bower_components/angular/angular.js',
                 'bower_components/angular-animate/angular-animate.js'
                ]
            },
           api: {
                src: ['app/**/*.js', '!app/**/*-spec.js'],
                title: 'Docs'
            }
        }

4.在命令行执行grunt ngdocs 生成一个docs文件夹并产生index.html就是产生的文档说明了


0 0
原创粉丝点击