Documentation or examples for ngdoc usage?

7,638 views
Skip to first unread message

Matt Calthrop

unread,
Jul 16, 2013, 11:26:21 AM7/16/13
to ang...@googlegroups.com
Hi all

I want to comment my code such that later I can include a doc-generation task as part of a build process.

The only reference to ngdoc I could find on the Angular site was here, where it says:
To see how we document our APIs, please check out the existing ngdocs.

So I have been looking at the Angular source as an example, but the examples there are a bit limited: I am not defining variables on the global scope as the code there does.

Examples of the code I want to document:

angular.module(
        'MainApp',
        [
            'Module1',
            'Module2',
            ...
        ]
    ).config(
        [
            '$routeProvider',
            function ($routeProvider) {
                $routeProvider.when(
                    '/home',
                    {
                        templateUrl: 'path/to/home-main-view.html',
                        controller: 'HomeController'
                    }
                ).when(
                    '/profiles',
                    {
                        templateUrl: 'path/to/profiles-main-view.html',
                        controller: 'ProfilesController'
                    }

                ...

                ).otherwise(
                    {
                        redirectTo: '/home'
                    }
                );
            }
        ]
    );

And this:

angular.module(
        'HomeControllerModule',
        [
        ]
    )
    .controller(
        'HomeController',
        [
            '$scope',
            'MenuMainModel',
            'HomeDataService',
            'HomeWrapperService',
            'HomeModel',
            'PageTitleModel',
            'PageHeaderModel',
            function ($scope, MenuMainModel, HomeDataService, HomeWrapperService, HomeModel, PageTitleModel, PageHeaderModel) {
                $scope.homeModel = HomeModel;

                // ...

            }
        ]
    );

Can anyone point me in the direction of some examples and/or documentation?

I've been googling, but to no avail so far...

thanks in advance

Matt



Matt Calthrop

unread,
Jul 17, 2013, 6:17:53 AM7/17/13
to ang...@googlegroups.com
Bump!

Matt Calthrop

unread,
Jul 17, 2013, 7:07:34 AM7/17/13
to ang...@googlegroups.com
I just found this reference:

It's helpful, and also has a link to a jsdoc reference page:

But I'd love to see a list of angular-specific commenting examples.

Anyone?

Matt

Chris Trees

unread,
Aug 7, 2013, 5:44:29 PM8/7/13
to ang...@googlegroups.com
I'm searching down the same line... I've heard Vojtech Jina reference it in Testacular / Karma but can't locate 'doc and test' on the 'doc and test' ;-)... 

Matt Calthrop

unread,
Oct 16, 2013, 6:19:33 AM10/16/13
to ang...@googlegroups.com
Update: I have managed to get a grunt build working that generates HTML documentation using the `grunt-ngdocs` plugin.

This issue I raised might be of interest:

And here's my source tree:
https://github.com/mcalthrop/profiles/tree/imp/angular

HTH!

Matt
Reply all
Reply to author
Forward
0 new messages