From 4216759d5888fa73c47d3c419f53eaf0bd191d7c Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Mon, 5 Feb 2018 18:26:33 +0000 Subject: [PATCH] mgr/dashboard_v2: add style guide to the frontend README Add a README section for style guide where it mentions how to organize the typescript imports. Signed-off-by: Tiago Melo --- .../mgr/dashboard_v2/frontend/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/pybind/mgr/dashboard_v2/frontend/README.md b/src/pybind/mgr/dashboard_v2/frontend/README.md index 5e39db51953..75554d5f287 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/README.md +++ b/src/pybind/mgr/dashboard_v2/frontend/README.md @@ -54,3 +54,22 @@ src/app/core/auth> ng generate component login -m=core/auth or, alternatively: src/app> ng generate component core/auth/login -m=core/auth ``` + +## Recommended style guide + +### Typescript + +Group the imports based on its source and separate them with a blank line. + +The source groups can be either from angular, external or internal. + +Example: +```javascript +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToastsManager } from 'ng2-toastr'; + +import { Credentials } from '../../../shared/models/credentials.model'; +import { HostService } from './services/host.service'; +``` \ No newline at end of file -- 2.39.5