Git Product home page Git Product logo

Comments (1)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 18, 2024
As the wiki-doc says: this tag is to "describe the property in the 
constructor's comment"
[http://code.google.com/p/jsdoc-toolkit/wiki/DocExamples]

So properties are intended to be placed in constructor's doc comment. You 
actually
_can_ add them to doc comment for an object but the template doesn't display it 
(I've
modified the latest version of the htm template in the repository so that it 
now does
show object properties) but you should note that the idea of @property is to be 
a
light-weight version of a full doc comment -- and it describes a property OF
something, not the property itself. So your example should be rewritten;

/**
    status codes for operations
    @property {number} success Returns 0 for successful operation
    @property {number} success Returns -1 for a failure
*/
var status = {
    success : 0,
    failure : -1
}

or, alternatively

/**
    status codes for operations
*/
var status = {
    /**
    * 0 for successful operation
    * @type number
    */
    success : 0,
    /**
    * -1 for a failure
    * @type number
    */
    failure : -1
}

depending on how important you think the "success" and "failure" objects are 
(whether
they merit their own full doc comments, or just a mention in the parent's doc 
comment).

Original comment by micmath on 13 Jul 2007 at 10:05

  • Changed state: Fixed
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from jsdoc-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.