From 8efa96d849e43785db0d4b865ea82030f9fe9ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Wed, 8 Jun 2016 23:25:52 +0200 Subject: [PATCH] feat(*): rename ANGULAR2_GOOGLE_MAPS_* constants This removes the ANGULAR2_ prefix. BREAKING CHANGES `ANGULAR2_GOOGLE_MAPS_PROVIDERS` is now called `GOOGLE_MAPS_PROVIDERS`. `ANGULAR2_GOOGLE_MAPS_DIRECTIVES`is now called `GOOGLE_MAPS_DIRECTIVES`. Please update existing import of these two constants in your code. Related to #395 Closes #406 --- docs/_partials/homepage/quickstart-example.ejs | 8 ++++---- docs/getting-started.jade | 10 +++++----- src/core/directives-const.ts | 2 +- src/core/directives.ts | 2 +- src/core/index.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/_partials/homepage/quickstart-example.ejs b/docs/_partials/homepage/quickstart-example.ejs index 9cd4eba4b..e2c1117dd 100644 --- a/docs/_partials/homepage/quickstart-example.ejs +++ b/docs/_partials/homepage/quickstart-example.ejs @@ -2,13 +2,13 @@ import {Component} from '@angular/core'; import {bootstrap} from '@angular/platform-browser-dynamic'; import { -ANGULAR2_GOOGLE_MAPS_DIRECTIVES, -ANGULAR2_GOOGLE_MAPS_PROVIDERS +GOOGLE_MAPS_DIRECTIVES, +GOOGLE_MAPS_PROVIDERS } from 'angular2-google-maps/core'; @Component({ selector: 'app-component', - directives: [ANGULAR2_GOOGLE_MAPS_DIRECTIVES] + directives: [GOOGLE_MAPS_DIRECTIVES] template: ` <sebm-google-map [latitude]="lat" [longitude]="lng"> </sebm-google-map> @@ -19,4 +19,4 @@ class AppComponent { lng: number = 33.2; } -bootstrap(AppComponent, [ANGULAR2_GOOGLE_MAPS_PROVIDERS]); +bootstrap(AppComponent, [GOOGLE_MAPS_PROVIDERS]); diff --git a/docs/getting-started.jade b/docs/getting-started.jade index d7dbc1b58..277a14968 100644 --- a/docs/getting-started.jade +++ b/docs/getting-started.jade @@ -344,11 +344,11 @@ a.button.button-icon.blue-light(href='http://plnkr.co/edit/YX7W20?p=preview') &r :marked ```typescript import {Component} from '@angular/core'; - import {ANGULAR2_GOOGLE_MAPS_DIRECTIVES} from 'angular2-google-maps/core'; + import {GOOGLE_MAPS_DIRECTIVES} from 'angular2-google-maps/core'; @Component({ selector: 'my-app', - directives: [ANGULAR2_GOOGLE_MAPS_DIRECTIVES], // this loads all angular2-google-maps directives in this component + directives: [GOOGLE_MAPS_DIRECTIVES], // this loads all angular2-google-maps directives in this component // the following line sets the height of the map - Important: if you don't set a height, you won't see a map!! styles: [` .sebm-google-map-container { @@ -385,11 +385,11 @@ a.button.button-icon.blue-light(href='http://plnkr.co/edit/YX7W20?p=preview') &r ```typescript import {bootstrap} from '@angular/platform-browser-dynamic'; import {AppComponent} from './app.component'; - import {ANGULAR2_GOOGLE_MAPS_PROVIDERS} from 'angular2-google-maps/core'; + import {GOOGLE_MAPS_PROVIDERS} from 'angular2-google-maps/core'; // this line boots our application on the page in the element: - // Note: It is required to add the ANGULAR2_GOOGLE_MAPS_PROVIDERS here! - bootstrap(AppComponent, [ANGULAR2_GOOGLE_MAPS_PROVIDERS]); + // Note: It is required to add the GOOGLE_MAPS_PROVIDERS here! + bootstrap(AppComponent, [GOOGLE_MAPS_PROVIDERS]); ``` ### Final project structure Our final project structure should look like this: diff --git a/src/core/directives-const.ts b/src/core/directives-const.ts index 143cfb09d..94d052908 100644 --- a/src/core/directives-const.ts +++ b/src/core/directives-const.ts @@ -2,5 +2,5 @@ import {SebmGoogleMap} from './directives/google-map'; import {SebmGoogleMapInfoWindow} from './directives/google-map-info-window'; import {SebmGoogleMapMarker} from './directives/google-map-marker'; -export const ANGULAR2_GOOGLE_MAPS_DIRECTIVES: any[] = +export const GOOGLE_MAPS_DIRECTIVES: any[] = [SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapInfoWindow]; diff --git a/src/core/directives.ts b/src/core/directives.ts index 49f51a04d..f7e5d4314 100644 --- a/src/core/directives.ts +++ b/src/core/directives.ts @@ -1,4 +1,4 @@ -export {ANGULAR2_GOOGLE_MAPS_DIRECTIVES} from './directives-const'; +export {GOOGLE_MAPS_DIRECTIVES} from './directives-const'; export {SebmGoogleMap} from './directives/google-map'; export {SebmGoogleMapInfoWindow} from './directives/google-map-info-window'; export {SebmGoogleMapMarker} from './directives/google-map-marker'; diff --git a/src/core/index.ts b/src/core/index.ts index 24ffb8953..d3e4f11dd 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -8,6 +8,6 @@ export * from './directives'; export * from './services'; export * from './events'; -export const ANGULAR2_GOOGLE_MAPS_PROVIDERS: any[] = [ +export const GOOGLE_MAPS_PROVIDERS: any[] = [ new Provider(MapsAPILoader, {useClass: LazyMapsAPILoader}), ];