Skip to content

Code Contribution Guideline

jmarkowski edited this page Feb 5, 2020 · 21 revisions

Methods and Variables naming

  • public: lowerCamelCase. Example: firstName, addProductToShopCart()
  • private: lowerCamelCase with _ prefix. Example: _firstName, _addProductToShopCart()

Comments

  • Comments should be consistent, for *.ts files, we should add comments, directly above the commented property.
/** Example of 1 line comment */
public firstName: string = '';

/** 
 * Example of comment with 
 * text longer than 1 line
 */
public firstName: string = '';
/** 
 * @hidden
 * Example of comment for cycle method, that requires some comment
 */
private _removeList(): void {}

/** @hidden */
private _propertyWithoutComment: string;

Angular

  • All components should have changeDetectionStrategy.OnPush. It improves the performance of library.

Clone this wiki locally