Skip to content

Code Style

Denys Vuika edited this page May 11, 2016 · 16 revisions

The code style is defined in the tslint.json and .editorconfig files.

conventions:

  • private functions and variables must have "private" keyword and named with "_" has suffix.
  • leave one whitespace character inside of the import statements' curly braces ("ES6 import/export braces" rule for IntelliJ IDEA)
  • leave one whitespace character after type reference colon ':' ("After type reference colon ':'" rule for IntelliJ IDEA)

Component structure:


- root
   - i18n
      - en.json
      - it.json
      - gr.json
   - src
      - components
         - example-name.component.ts
         - example-name.component.html
         - example-name.component.css
      - directives
         - example-name.directive.ts
      - models
         - example-name.model.ts
      - services
         - example-name.service.ts
   - test
     - components
       - example-name.component.spec.ts
     - directives
       - example-name.directive.spec.ts
     - services
       - example-name.service.spec.ts
     - index.html
   - .travis.yml
   - README.md
   - LICENSE
   - package.json
   - tslint.json
   - tsconfig.json
   - .editorconfig
   - typings.json

May you want to use our yeoman generator to create a new component generator-ng2-alfresco-component

Clone this wiki locally