Skip to content

Commit 059951c

Browse files
committed
refactor(google-maps): remove unnecessary modules
Removes the `GoogleMapModule` and `MapMarkerModule` since they're redundant.
1 parent 8e141ef commit 059951c

File tree

12 files changed

+29
-105
lines changed

12 files changed

+29
-105
lines changed

src/google-maps/google-map/google-map-module.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/google-maps/google-map/google-map.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ import {Component} from '@angular/core';
22
import {async, TestBed} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44

5-
import {MapMarker, MapMarkerModule} from '../map-marker/index';
5+
import {GoogleMapsModule} from '../google-maps-module';
6+
import {MapMarker} from '../map-marker/map-marker';
67
import {
78
createMapConstructorSpy,
89
createMapSpy,
910
TestingWindow
1011
} from '../testing/fake-google-map-utils';
11-
1212
import {
1313
DEFAULT_HEIGHT,
1414
DEFAULT_OPTIONS,
1515
DEFAULT_WIDTH,
1616
GoogleMap,
17-
GoogleMapModule,
1817
UpdatedGoogleMap
19-
} from './index';
18+
} from './google-map';
2019

2120
/** Represents boundaries of a map to be used in tests. */
2221
const testBounds: google.maps.LatLngBoundsLiteral = {
@@ -39,8 +38,7 @@ describe('GoogleMap', () => {
3938
beforeEach(async(() => {
4039
TestBed.configureTestingModule({
4140
imports: [
42-
GoogleMapModule,
43-
MapMarkerModule,
41+
GoogleMapsModule,
4442
],
4543
declarations: [TestApp],
4644
});

src/google-maps/google-map/google-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import {BehaviorSubject, combineLatest, Observable, Subject} from 'rxjs';
2525
import {map, shareReplay, take, takeUntil} from 'rxjs/operators';
2626

27-
import {MapMarker} from '../map-marker/index';
27+
import {MapMarker} from '../map-marker/map-marker';
2828

2929
interface GoogleMapsWindow extends Window {
3030
google?: typeof google;

src/google-maps/google-map/index.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/google-maps/google-maps-module.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88

99
import {NgModule} from '@angular/core';
1010

11-
import {GoogleMap, GoogleMapModule} from './google-map/index';
12-
import {MapInfoWindow, MapInfoWindowModule} from './map-info-window/index';
13-
import {MapMarker, MapMarkerModule} from './map-marker/index';
11+
import {GoogleMap} from './google-map/google-map';
12+
import {MapInfoWindow} from './map-info-window/map-info-window';
13+
import {MapMarker} from './map-marker/map-marker';
14+
15+
const COMPONENTS = [
16+
GoogleMap,
17+
MapInfoWindow,
18+
MapMarker,
19+
MapInfoWindow,
20+
];
1421

1522
@NgModule({
16-
imports: [
17-
GoogleMapModule,
18-
MapInfoWindowModule,
19-
MapMarkerModule,
20-
],
21-
exports: [
22-
GoogleMap,
23-
MapInfoWindow,
24-
MapMarker,
25-
],
23+
declarations: COMPONENTS,
24+
exports: COMPONENTS,
2625
})
2726
export class GoogleMapsModule {
2827
}

src/google-maps/map-info-window/map-info-window-module.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/google-maps/map-info-window/map-info-window.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {Component} from '@angular/core';
22
import {async, TestBed} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44

5-
import {DEFAULT_OPTIONS, GoogleMapModule, UpdatedGoogleMap} from '../google-map/index';
6-
import {MapMarker} from '../map-marker/index';
5+
import {DEFAULT_OPTIONS, UpdatedGoogleMap} from '../google-map/google-map';
6+
import {MapMarker} from '../map-marker/map-marker';
77
import {
88
createInfoWindowConstructorSpy,
99
createInfoWindowSpy,
@@ -12,17 +12,15 @@ import {
1212
TestingWindow
1313
} from '../testing/fake-google-map-utils';
1414

15-
import {MapInfoWindow, MapInfoWindowModule} from './index';
15+
import {GoogleMapsModule} from '../google-maps-module';
16+
import {MapInfoWindow} from './index';
1617

1718
describe('MapInfoWindow', () => {
1819
let mapSpy: jasmine.SpyObj<UpdatedGoogleMap>;
1920

2021
beforeEach(async(() => {
2122
TestBed.configureTestingModule({
22-
imports: [
23-
GoogleMapModule,
24-
MapInfoWindowModule,
25-
],
23+
imports: [GoogleMapsModule],
2624
declarations: [TestApp],
2725
});
2826
}));

src/google-maps/map-marker/index.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/google-maps/map-marker/map-marker-module.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/google-maps/map-marker/map-marker.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import {
88
TestingWindow
99
} from '../testing/fake-google-map-utils';
1010

11-
import {DEFAULT_MARKER_OPTIONS, MapMarker, MapMarkerModule} from './index';
11+
import {GoogleMapsModule} from '../google-maps-module';
12+
import {DEFAULT_MARKER_OPTIONS, MapMarker} from './map-marker';
1213

1314
describe('MapMarker', () => {
1415
beforeEach(async(() => {
1516
TestBed.configureTestingModule({
16-
imports: [MapMarkerModule],
17+
imports: [GoogleMapsModule],
1718
declarations: [TestApp],
1819
});
1920
}));

src/google-maps/public-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export {GoogleMap} from './google-map/index';
9+
export {GoogleMap} from './google-map/google-map';
10+
export {MapMarker} from './map-marker/map-marker';
11+
export {GoogleMapsModule} from './google-maps-module';
1012
export {MapInfoWindow} from './map-info-window/index';
11-
export {MapMarker} from './map-marker/index';
12-
export * from './google-maps-module';

src/google-maps/testing/fake-google-map-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {UpdatedGoogleMap} from '../google-map/index';
9+
import {UpdatedGoogleMap} from '../google-map/google-map';
1010

1111
/** Window interface for testing */
1212
export interface TestingWindow extends Window {

0 commit comments

Comments
 (0)