Skip to content

meumobi/mmb-demos.master-detail-ionic4

Repository files navigation

Coding best practices

Implement Stacked Master-Detail Pattern

Furthermore

REST API integration with Auth Based Token

Backlog

Login Flow with Angular Router and and Guards

Furthermore

Backlog

PWA

Full examples of “Well implemented” Angular Apps

Continuous integration with Travis CI

Automated dependency updates with Greenkeeper

Typescript path mapping

An Angular app’s file structure can be relatively deep, making it difficult to figure out where a module lives when importing it. The idea is to make your import paths go from ../../../../ to @namespace. TypeScript compiler supports the declaration of mappings using "paths" property in tsconfig.json files. Using TypeScript path mapping make import statements in your Angular app shorter and much more developer-friendly

// tsconfig.json in the root dir

{
  "compileOnSave": false,
  "compilerOptions": {

    // omitted...

    "baseUrl": "src",
    "paths": {
      "@core/*": ["app/core/*"],
      "@shared/*": ["app/shared/*"],
      "@items/*": ["app/items/*"]
      "@env/*": ["environments/*"]
    }
  }
}

Then instead of

// import from component.ts
import { MyService } from '../../../core/api.service';

we can use custom namespace @core declared on tsconfig.json to use following import:

// import from component.ts
import { MyService } from '@core/services/api.service';

More details

Performance

Angular preloading strategy

Adding PreloadAllModules strategy on your RouterModule, you can preload all of the modules in the background asynchronously. This will help boost up the loading time and performance tremendously. You can also ceate your own preloading strategy by implementing its PreloadingStrategy class.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published