Socket
Book a DemoInstallSign in
Socket

ovh-angular-mondial-relay

Package Overview
Dependencies
Maintainers
12
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ovh-angular-mondial-relay

Display a map to select mondial relay

latest
Source
npmnpm
Version
4.1.1
Version published
Weekly downloads
2
-33.33%
Maintainers
12
Weekly downloads
 
Created
Source

Display a map to select mondial relay

githubbanner

Maintenance Chat on gitter Build Status

NPM

<mondial-relay data-ng-model="myRelay"></mondial-relay>

Installation

Bower

bower install ovh-angular-mondial-relay --save

NPM

npm install ovh-angular-mondial-relay --save

Howto's

Configuration

In your app.js, inject the module

angular.module("myModule", ["ovh-angular-mondial-relay"]);

In your index.html, inject scripts and styles

    <script src="bower_components/mondial-relay/dist/mondial-relay.min.js"></script>
    <link rel="stylesheet" href="bower_components/mondial-relay/dist/mondial-relay.min.css" />

Translations

Translations are available in xml files in folder https://github.com/ovh-ux/ovh-angular-mondial-relay/blob/master/src/mondial-relay/translations

The more convinent is to convert these files in json and provide partial translation files via mondialRelayProvider

Requests to API

You need 2 services to request API:

SupplyMondialRelay

angular.module("myApp").service("SupplyMondialRelay", function ($q) {
    return {
        Lexi: function () {
            return {
                search: function (filter) {
                    // perform the request here
                    return $q.when(response);
                }
            }
        }
    }
});

where filter is a json object containing:

  • address {String} (optional): i.e. : "route de gorrekear"
  • city {String} (optional if zipcode is specified): i.e. : "le folgoet"
  • country {String} (mendatory): i.e. : "fr"
  • zipcode {String} (optional if city is specified): i.e. : "29260"

where response is a json like:

{
  "status": "ok",
  "error": null,
  "result": {
    "referenceAddress": "Route de Gorrekear, 29260 Le Folgoët, France",
    "relayPoints": [
      {
        "country": "fr",
        "distance": 1477,
        "lat": 48.5720143,
        "lng": -4.3266499,
        "name": "VERT ANIS",
        "opening": {
          "sunday": null,
          "wednesday": [
            {
              "start": "0900",
              "end": "1200"
            },
            {
              "start": "1400",
              "end": "1900"
            }
          ]
        },
        "zipcode": "29260",
        "mapUrl": "https://ww2.mondialrelay.com/public/permanent/plan_relais.aspx?ens=BDOVHSAS11&num=043966&pays=FR&crc=79C55FC21A44C73C1D90749C2B510F34",
        "city": "LESNEVEN",
        "pictureUrl": "https://www.mondialrelay.fr/media/51887/encart-suivi-de-colis_899x160.jpg",
        "id": "043966",
        "address": "PLACE DE L EUROPE",
        "closing": null
      },
    ]
  }
}

User

angular.module("myApp").service("User", function ($q) {
    return {
        Lexi: function () {
            return {
                get: function (filter) {
                    // perform the request here
                    return $q.when({
                        country: "fr",      // country is mendatory
                        zip: "29260",       // zip or city can be provided
                        city: "Le Folgoët"
                    });
                }
            }
        }
    }
});

Get the sources

    git clone https://github.com/ovh-ux/ovh-angular-mondial-relay.git
    cd ovh-angular-mondial-relay
    npm install
    bower install

You've developed a new cool feature ? Fixed an annoying bug ? We'd be happy to hear from you !

Have a look in CONTRIBUTING.md

If you use literal text, you must declare it as a translation, only in the french translation file https://github.com/ovh-ux/ovh-angular-mondial-relay/blob/master/src/mondial-relay/translations/Messages_fr_FR.xml

Run the tests

npm test

Build the documentation

grunt ngdocs

License

See https://github.com/ovh/ovh-angular-mondial-relay/blob/master/LICENSE

FAQs

Package last updated on 24 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts