Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting $scope properties #90

Open
Nate-Wilkins opened this issue Jan 14, 2014 · 2 comments
Open

Documenting $scope properties #90

Nate-Wilkins opened this issue Jan 14, 2014 · 2 comments

Comments

@Nate-Wilkins
Copy link

I'm currently using docular to document our JavaScript modules and our AngularJS components. However I've had a tough time dealing with the repetitive nature that docular forces on the developer. ex.

@doc Property
@propertyOf ns:myObj
@name ns:myObj#myProperty

But now my real problem is documenting angular controllers with the ngdoc type controller

/**
 * @ngdoc Controller
 * @name ns:MyCtrl
 * @description A description
 */
angular.module('app').controller('MyCtrl', function ($scope) { 

    /**
     * @ngdoc Property
     * @name ns:Myctrl#myProperty
     * @description A description
     */
    $scope.myProperty = 42;

});

Documentation on docular is a little rough in spots. Might send a PR if I can understand it more.

@vincentdieltiens
Copy link

If I understand well, you want to documentate $scope properties ?
For what purpose ?

I think that not everything in a code needs to be documented.
Documentation is for people who is writing code that interact with yours :

  • your code is a library
  • for internal use : remember how to use a component

In case of scope properties, they are private to the scope. I don't the see the purpose of documenting those, because you should never access it outside the controller (or the template of the controller)

@Nate-Wilkins
Copy link
Author

I'm talking directives mostly. Although on occasion a sub controller/template pair would need to be documented.

I do agree that not everything needs to be documented and am a big believer in self documenting code but this is not a project that persists of just myself. It's a pretty big project with a multitude of developers that need to know how to use certain components internally that they didn't make but have to use.

Documenting what's on $scope would be very helpful for directive components for a dev guide. Although maybe only the 'localized' scope properties set on the directive should be documented (ideally)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants