dev:angular_dev_best_practices
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:angular_dev_best_practices [2019/07/10 00:38] – [Evergreen Angular Development Best Practices] sandbergja | dev:angular_dev_best_practices [2023/11/24 23:05] (current) – [Code quality] update outdated command sandbergja | ||
---|---|---|---|
Line 4: | Line 4: | ||
Loose collection of practices to review with developers so we can agree on UI developer guidelines. | Loose collection of practices to review with developers so we can agree on UI developer guidelines. | ||
+ | ==== Code quality ==== | ||
* Run %%'ng build --prod' | * Run %%'ng build --prod' | ||
Line 9: | Line 10: | ||
* Run 'ng lint' before committing. | * Run 'ng lint' before committing. | ||
* This does more than check style, it also warns when an import pulls in too much code, among other things. | * This does more than check style, it also warns when an import pulls in too much code, among other things. | ||
- | * Make sure that ' | + | * Make sure that ' |
* use camelCase variables when possible for consistency. | * use camelCase variables when possible for consistency. | ||
- | * Design for screen width of 1350 pixels. | ||
- | * This is somewhat arbitrary, but seems to cover most laptops and smaller (non-mobile) screens without being too limiting. | ||
- | * Browser dev tools can show the width of the current browser window. | ||
* Use 2-space indentation in HTML files | * Use 2-space indentation in HTML files | ||
* Use 4-space indentation in Typescript and CSS files. | * Use 4-space indentation in Typescript and CSS files. | ||
* Avoid column widths in code that extend well beyond 80-100 characters | * Avoid column widths in code that extend well beyond 80-100 characters | ||
+ | * Avoid subscribing to Observables within other subscriptions (nested subscriptions). | ||
+ | |||
+ | ==== UI ==== | ||
+ | |||
+ | * Design for screen width of 1350 pixels. | ||
+ | * This is somewhat arbitrary, but seems to cover most laptops and smaller (non-mobile) screens without being too limiting. | ||
+ | * Browser dev tools can show the width of the current browser window. | ||
* Use Bootstrap utility classes when possible instead of writing custom CSS. | * Use Bootstrap utility classes when possible instead of writing custom CSS. | ||
* https:// | * https:// | ||
Line 30: | Line 35: | ||
* The [[https:// | * The [[https:// | ||
* Don't add Bootstrap' | * Don't add Bootstrap' | ||
+ | * Make sure that your screens have an < | ||
dev/angular_dev_best_practices.1562733496.txt.gz · Last modified: 2022/02/10 13:34 (external edit)