Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vojvodicn23 committed Sep 15, 2024
1 parent 8ad8b19 commit 87dc1d2
Show file tree
Hide file tree
Showing 24 changed files with 10,839 additions and 2,767 deletions.
33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
# HttpHandler
# Angular HTTP Handler

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.15.
An Angular library for handling HTTP requests with loading state management, error handling, retry logic, and fallback values.

## Development server
## Features

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
- Automatically sets loading state during HTTP requests
- Handles errors with an optional error handler
- Supports retry logic for failed requests
- Provides a fallback value when the request fails
- Can return empty arrays or null based on the response type

## Code scaffolding
## Installation

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
To install the library, run the following command:

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
```bash
npm install angular'http-handler
124 changes: 124 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,129 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-http-handler": {
"projectType": "library",
"root": "projects/angular-http-handler",
"sourceRoot": "projects/angular-http-handler/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/angular-http-handler/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/angular-http-handler/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/angular-http-handler/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/angular-http-handler/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
}
}
}
},
"http-handler-example": {
"projectType": "application",
"schematics": {},
"root": "projects/http-handler-example",
"sourceRoot": "projects/http-handler-example/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/http-handler-example",
"index": "projects/http-handler-example/src/index.html",
"main": "projects/http-handler-example/src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "projects/http-handler-example/tsconfig.app.json",
"assets": [
"projects/http-handler-example/src/favicon.ico",
"projects/http-handler-example/src/assets"
],
"styles": [
"projects/http-handler-example/src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "http-handler-example:build:production"
},
"development": {
"browserTarget": "http-handler-example:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "http-handler-example:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "projects/http-handler-example/tsconfig.spec.json",
"assets": [
"projects/http-handler-example/src/favicon.ico",
"projects/http-handler-example/src/assets"
],
"styles": [
"projects/http-handler-example/src/styles.css"
],
"scripts": []
}
}
}
}
}
}
Loading

0 comments on commit 87dc1d2

Please sign in to comment.