AndrewJBateman / angular-api-gouvfr

:clipboard: Angular app to search for address data from the French Government official API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

โšก Angular API Gouv.fr

  • Angular app using an ngForm and RxJS operators and the French Gouvernment API to search for addresses in France
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

๐Ÿ“ท Screenshots

Example screenshot

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Install dependencies by running npm i
  • Run ng serve for a dev server. Navigate to http://localhost:4200/.
  • The app will automatically reload if you change any of the source files

๐Ÿ”ฆ Testing

  • n/a

๐Ÿ’ป Code Examples

  • extract from app.component.html client form input field with autocomplete
<form class="search-form-input">
  <mat-form-field class="search-full-width" appearance="fill">
    <input
      class="search-input"
      type="text"
      placeholder="Enter query"
      aria-label="query input field"
      matInput
      [formControl]="formControl"
      [matAutocomplete]="auto"
    />

    <!--autocomplete address using displayFctn to list options-->
    <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFctn">
      <mat-option *ngIf="isLoading" class="is-loading">
        <mat-progress-bar mode="query"></mat-progress-bar>
      </mat-option>
      <ng-container *ngIf="!isLoading">
        <mat-option *ngFor="let option of options" [value]="option">
          {{ displayFctn(option) }}
        </mat-option>
      </ng-container>
    </mat-autocomplete>
  </mat-form-field>
  </form>

๐Ÿ†’ Features

  • auto address complete
  • No API key required
  • Material module created and passed to modules that need it via the Shared module. The need for shared modules is debated and is set up here for the app to grow in size.

๐Ÿ“‹ Status & To-Do List

  • Status: Simple Working address search. Only works with Ivy compiler disabled.
  • To-Do: Nothing

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

  • Repo created by ABateman, email: gomezbateman@yahoo.com

About

:clipboard: Angular app to search for address data from the French Government official API

License:MIT License


Languages

Language:TypeScript 72.5%Language:JavaScript 13.4%Language:HTML 11.2%Language:SCSS 2.9%