Useless Piece Of Shit

Coding in Style

Why Angular

What is Coding Style

Contents

Single Responsiblity

Rule of One

Why 101

Reusable,  

Easy to read,  

Less mistakes

One component per file -

Small Functions()

Why small()

Reuse  

Read  

Maintain  

Small functions() -

Naming

feature.type.ts

Custom prefix for components

Custom prefix for directives

Coding convention

Application structure and NgModules

  • src
  • app
    • core
      • core.module.ts
      • spinner
        • spinner.component.ts|html|css|spec.ts
        • spinner.service.ts|spec.ts
    • Shared
      • shared.module.ts
      • pipes
        • init-caps.pipe.ts|spec.ts
      • components
        • text-filter.component.ts|spec.ts
      • services
        • text-filter.service.ts|spec.ts
    • hero
      • hero.module.ts
      • store
        • index.ts
        • reducers
          • index.ts
        • effects
          • index.ts
        • selectors
          • index.ts
        • actions
          • index.ts
        • models
          • index.ts
        • services
          • index.ts
      • components
        • hero-detail.html|css|ts|spec.ts
      • containers
        • hero-list.html|css|ts|spec.ts
  • app.component.ts|html|css|spec.ts
  • app.module.ts
  • app-routing.module.ts
  • main.ts
  • index.html

kaboom