From 33a2c576a14bb9c7641b17d5c7f4286627f5537d Mon Sep 17 00:00:00 2001 From: mareczek Date: Sat, 12 Sep 2015 01:46:32 +0200 Subject: [PATCH] Update README.md Added instruction for overloading defaults in angulars config phase and added new options --- README.md | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 60b71d2..686bfbb 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,30 @@ Same as in source project (https://github.com/Bluefieldscom/intl-tel-input) Sneak preview: ```coffeescript - options = - autoFormat: true - autoHideDialCode: true - defaultCountry: '' - nationalMode: false - numberType: '' - onlyCountries: undefined - preferredCountries: ['us', 'gb'] - responsiveDropdown: false - utilsScript: "" + allowExtensions: false + autoFormat: true + autoHideDialCode: true + autoPlaceholder: true + customPlaceholder: null + defaultCountry: "" + geoIpLookup: null + nationalMode: true + numberType: "MOBILE" + onlyCountries: undefined + preferredCountries: ['us', 'gb'] + utilsScript: "" +``` + +Global configuration (in angulars config phase) +--- +There is a constant `ipnConfig` available in which all of the defaults are configured. +To change the defaults simply use the `ipnConfig` object: +```coffeescript +angular.module('app') + .config (ipnConfig) -> + ipnConfig.defaultCountry = 'pl' + ipnConfig.preferredCountries = ['pl', 'de', 'fr', 'uk', 'es'] + ``` Usage