Skip to content

Instantly share code, notes, and snippets.

@malbarmavi
Created January 21, 2021 13:24
Show Gist options
  • Save malbarmavi/93b9b5658373b6ba13154f5ff00e99c5 to your computer and use it in GitHub Desktop.
Save malbarmavi/93b9b5658373b6ba13154f5ff00e99c5 to your computer and use it in GitHub Desktop.
angular basic topic

Read it First : https://angular.io/guide/styleguide

Multiple Environments.

https://angular.io/guide/build#building-and-serving-angular-apps

https://dev.to/mikgross/set-up-multiple-environments-in-angular-376c

Typescript Aliases.

https://medium.com/slackernoon/use-typescript-aliases-to-clean-up-your-import-statements-7210b7ec2af1

Barrel.

https://basarat.gitbook.io/typescript/main-1/barrel

https://medium.com/@adrianfaciu/barrel-files-to-use-or-not-to-use-75521cd18e65

Custom Preloading Strategy .

https://github.com/codica2/angular-best-practices#choose-right-preload-strategy

Variable, function naming convention

https://github.com/airbnb/javascript

File Naming Convention

https://angular.io/guide/styleguide#separate-file-names-with-dots-and-dashes

Use trackBy function in ngFor

https://blog.bitsrc.io/angular-optimization-use-trackby-option-for-ngfor-directive-72c9509b2be9

https://netbasal.com/angular-2-improve-performance-with-trackby-cc147b5104e5

https://github.com/codica2/angular-best-practices

https://www.ahmedbouchefra.com/angular-ngfor-index-trackby-example/

Remove console.log on Production

https://medium.com/@niraj.rai/remove-console-logs-in-production-build-angular-2-above-3f75521635

Core & Shared & Feature Module Structure

https://angular.io/guide/module-types

Smart & Dumb Components

https://medium.com/generic-ui/an-enterprise-approach-to-the-smart-and-dumb-components-pattern-in-angular-37b6000f91de

Loader (Magic Loader with Interceptor or loaderService)

Layout (Design) aka.PageComponent

i18n & internalization -- Solved ngx-translate

Async Pipe

https://github.com/codica2/angular-best-practices#use-async-pipe

Unsubscribing to Subscriptions ex. (Activated Route)

https://www.mattspaulding.org/The-Best-Way-to-Unsubscribe-From-Angular-Observables/

Prefer Interface to Class

https://medium.com/front-end-weekly/typescript-class-vs-interface-99c0ae1c2136

Interceptor(s) ex.(token, loader, req.header, retry request)

https://medium.com/angular-in-depth/top-10-ways-to-use-interceptors-in-angular-db450f8a62d6

https://github.com/melcor76/interceptors/tree/master/src/app/interceptors

Reusable Components

Debug Level (LoggerService) ?

Security Vulnerabilities

https://geekflare.com/nodejs-security-scanner/

Dynamic Env : API_URL ? API_URL : window.location.path

TSLint deprecated -> ESLint

Router Memory Leak

Typescript Getter Setter Side Effect

ProvidedIn Tree Shakable Import

Lang Sync

DOC DOC DOC

https://github.com/svoboda-rabstvo/ngx-translate-lint

DEBUG_LEVEL = environments

ngx-translate/core#495

Frequently-used modules (Browser Module vs Common Module)

https://angular.io/guide/frequent-ngmodules

ReactiveFormsModule, test, translateService

https://forum.ionicframework.com/t/ionic-4-storage-token-access-for-http-interceptor/158822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment