Skip to content

Commit e4fed5e

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

File tree

10 files changed

+18
-78
lines changed

10 files changed

+18
-78
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: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@
88

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

11-
import {MapMarker, MapMarkerModule} from './map-marker/index';
12-
import {GoogleMap, GoogleMapModule} from './google-map/index';
11+
import {MapMarker} from './map-marker/map-marker';
12+
import {GoogleMap} from './google-map/google-map';
13+
14+
const COMPONENTS = [GoogleMap, MapMarker];
1315

1416
@NgModule({
15-
imports: [
16-
GoogleMapModule,
17-
MapMarkerModule,
18-
],
19-
exports: [
20-
GoogleMap,
21-
MapMarker,
22-
],
17+
declarations: COMPONENTS,
18+
exports: COMPONENTS,
2319
})
2420
export class GoogleMapsModule {
2521
}

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,6 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export {GoogleMap} from './google-map/index';
10-
export {MapMarker} from './map-marker/index';
11-
export * from './google-maps-module';
9+
export {GoogleMap} from './google-map/google-map';
10+
export {MapMarker} from './map-marker/map-marker';
11+
export {GoogleMapsModule} 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)