Classes must be named using the 'PastelCase' naming style. For example:
class Foo { ... }
class FooBar { ... }
Classes that are generated by the Ionic framework do not need documentation, as their purpose is known. For example:
class FooPage { ... }
class FooBarComponent { ... }
However, all methods that are added to these classes must be documented, as per the method documentation.
Functions and methods must be named using the 'camelCase' naming style. For example:
foo() { ... }
fooBar() { ... }
All methods and functions that are made by developers must have documentation. This documentation must include: - A brief description of what the method or function does
- Each parameter in the method or function declaration must have an @param tag in the documentation. The @param must be followed by the parameter name and a brief description of the parameter.
- If the method or function has a return type, the @returns tag must be included, as well as a brief description of what is returned.
For example:
/** * The function 'foo' does 'bar' **/ foo() { ... }
/** * fooBar does X * @param baz an A object used for X * @param buz a B object used for Y **/ fooBar(baz : A, buz: B) { ... }
/** * fizz does X * @returns a result of operation X **/ fizz() { ... return x; }Methods that are generated by the Ionic framework need not be documented, unless the developer adds code to the methods.