tbprojects / angular-starter

Angular starter project with dev API based on JSON Server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Starter

Angular starter project with dev API based on JSON Server.

Tech stack:

Development server & API

Adding new resources

  • add interface that defines a resource in projects/dev-api/types
  • add collection of records in projects/dev-api/mocks
  • add custom routes in projects/dev-api/routes
  • connect mocks in projects/dev-api/db.ts
  • connect custom routes in projects/dev-api/routes.ts

You can use @api/types/* path for accessing types in app.

You can use @api/mocks/* path for accessing mocks in unit tests.

NgModules

  • AppModule - should not be changed.
  • CoreModule - is used to import NgModules that should be loaded only once
  • SharedModule - is used to provide shared declarations and export widely used NgModules
  • MaterialModule - is used to handle the list of required Material Modules
  • TestingModule - is used to export widely used NgModules in component unit tests

Testing

  • use ng-mocks for mocking declarations (ex. MockComponent(SomeComponent))
  • use @testing/mock-helpers for mocking services (ex. MockService(SomeService))
  • use TestingModule in component tests

Preview

Preview

Author

Tomasz Borowski

About

Angular starter project with dev API based on JSON Server.


Languages

Language:TypeScript 79.1%Language:JavaScript 10.0%Language:HTML 8.6%Language:CSS 2.3%