Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit c50bc92

Browse files
timwright35sebholstein
authored andcommitted
feat(*): Support for RC6
Closes #604 Closes #613
1 parent fadcf03 commit c50bc92

File tree

10 files changed

+100
-74
lines changed

10 files changed

+100
-74
lines changed

karma-systemjs-config.js

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
11
(function (global) {
2+
var paths = {
3+
// paths serve as alias
4+
'npm:': 'base/node_modules/'
5+
};
26
var map = {
3-
'rxjs': 'base/node_modules/rxjs',
4-
'@angular': 'base/node_modules/@angular'
7+
// angular bundles
8+
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
9+
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
10+
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
11+
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
12+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
13+
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
14+
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
15+
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
16+
17+
// angular testing umd bundles
18+
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
19+
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
20+
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
21+
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
22+
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
23+
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
24+
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
25+
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
26+
27+
// other libraries
28+
'rxjs': 'npm:rxjs',
529
};
630
var packages = {
7-
'rxjs': { defaultExtension: 'js' },
31+
rxjs: {
32+
defaultExtension: 'js'
33+
}
834
};
9-
var packageNames = [
10-
'@angular/common',
11-
'@angular/compiler',
12-
'@angular/core',
13-
'@angular/platform-browser',
14-
'@angular/platform-browser-dynamic'
15-
];
16-
packageNames.forEach(function (pkgName) {
17-
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
18-
});
1935
var config = {
20-
map: map,
21-
packages: packages
36+
paths: paths,
37+
map: map,
38+
packages: packages
2239
};
2340
if (global.filterSystemConfig) {
24-
global.filterSystemConfig(config);
41+
global.filterSystemConfig(config);
2542
}
2643
System.config(config);
2744
})(this);

karma.conf.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@ module.exports = function(config) {
1414
},
1515
files: [
1616
{pattern: 'node_modules/core-js/client/core.js', included: true, watched: true},
17-
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: true},
18-
// Needed for async testsing {https://github.com/angular/angular/issues/8232}
19-
{pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: true},
17+
'node_modules/reflect-metadata/Reflect.js',
18+
'node_modules/zone.js/dist/zone.js',
19+
'node_modules/zone.js/dist/long-stack-trace-zone.js',
20+
'node_modules/zone.js/dist/proxy.js',
21+
'node_modules/zone.js/dist/sync-test.js',
22+
'node_modules/zone.js/dist/jasmine-patch.js',
23+
'node_modules/zone.js/dist/async-test.js',
24+
'node_modules/zone.js/dist/fake-async-test.js',
2025
{pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: true, watched: false },
2126
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: true},
2227

2328
{pattern: 'karma-systemjs-config.js', included: true, watched: true},
2429

25-
{pattern: 'node_modules/rxjs/**/*', included: false, watched: false},
26-
{pattern: 'node_modules/@angular/common/**/*', included: false, watched: false},
27-
{pattern: 'node_modules/@angular/core/**/*', included: false, watched: false},
28-
{pattern: 'node_modules/@angular/platform-browser/**/*', included: false, watched: false},
29-
{pattern: 'node_modules/@angular/compiler/**/*', included: false, watched: false},
30-
{pattern: 'node_modules/@angular/platform-browser-dynamic/**/*', included: false, watched: false},
30+
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
31+
{pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
32+
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
33+
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
3134

3235
{pattern: 'karma-test-shim.js', included: true, watched: true},
3336

package.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
},
2424
"homepage": "https://github.com/SebastianM/angular2-google-maps#readme",
2525
"dependencies": {
26-
"@angular/common": "2.0.0-rc.5",
27-
"@angular/compiler": "2.0.0-rc.5",
28-
"@angular/core": "2.0.0-rc.5",
29-
"@angular/platform-browser": "2.0.0-rc.5",
30-
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
31-
"reflect-metadata": "^0.1.3",
32-
"rxjs": "5.0.0-beta.6",
33-
"zone.js": "^0.6.12"
26+
"@angular/common": "2.0.0-rc.6",
27+
"@angular/compiler": "2.0.0-rc.6",
28+
"@angular/core": "2.0.0-rc.6",
29+
"@angular/platform-browser": "2.0.0-rc.6",
30+
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
31+
"rxjs": "5.0.0-beta.11",
32+
"zone.js": "^0.6.17"
3433
},
3534
"devDependencies": {
3635
"babel-eslint": "6.0.4",
@@ -64,21 +63,20 @@
6463
"run-sequence": "1.2.2",
6564
"systemjs": "0.19.29",
6665
"tslint": "3.13.0",
67-
"typescript": "1.8.10",
66+
"typescript": "^2.0.2",
6867
"typings": "1.0.4",
6968
"watchify": "3.7.0"
7069
},
7170
"jspm": {
7271
"jspmNodeConversion": false,
7372
"dependencies": {
74-
"@angular/common": "2.0.0-rc.5",
75-
"@angular/compiler": "2.0.0-rc.5",
76-
"@angular/core": "2.0.0-rc.5",
77-
"@angular/platform-browser": "2.0.0-rc.5",
78-
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
79-
"reflect-metadata": "^0.1.3",
80-
"rxjs": "5.0.0-beta.6",
81-
"zone.js": "^0.6.12"
73+
"@angular/common": "2.0.0-rc.6",
74+
"@angular/compiler": "2.0.0-rc.6",
75+
"@angular/core": "2.0.0-rc.6",
76+
"@angular/platform-browser": "2.0.0-rc.6",
77+
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
78+
"rxjs": "5.0.0-beta.11",
79+
"zone.js": "^0.6.17"
8280
}
8381
}
8482
}

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
'rxjs/Subject': 'Rx',
1313
'rxjs/observable/PromiseObservable': 'Rx',
1414
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
15-
'rxjs/Observable': 'Rx'
15+
'rxjs/Observable': 'Rx',
16+
'rxjs/Rx': 'Rx'
1617
}
1718
}

src/core/core-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ModuleWithProviders, NgModule, Provider, provide} from '@angular/core';
1+
import {ModuleWithProviders, NgModule, Provider} from '@angular/core';
22

33
import {SebmGoogleMap} from './directives/google-map';
44
import {SebmGoogleMapCircle} from './directives/google-map-circle';
@@ -27,7 +27,7 @@ export class AgmCoreModule {
2727
*/
2828
static forRoot(lazyMapsAPILoaderConfig?: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
2929
const providers: Provider[] =
30-
[...BROWSER_GLOBALS_PROVIDERS, provide(MapsAPILoader, {useClass: LazyMapsAPILoader})];
30+
[...BROWSER_GLOBALS_PROVIDERS, {provide: MapsAPILoader, useClass: LazyMapsAPILoader}];
3131
if (lazyMapsAPILoaderConfig) {
3232
providers.push(provideLazyMapsAPILoaderConfig(lazyMapsAPILoaderConfig));
3333
}

src/core/services/maps-api-loader/lazy-maps-api-loader.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Inject, Injectable, Optional, Provider, provide} from '@angular/core';
1+
import {Inject, Injectable, Optional, Provider} from '@angular/core';
22

33
import {DOCUMENT_GLOBAL, WINDOW_GLOBAL} from '../../utils/browser-globals';
44

@@ -183,7 +183,8 @@ export class LazyMapsAPILoader extends MapsAPILoader {
183183
*/
184184
export function provideLazyMapsAPILoaderConfig(confLiteral: LazyMapsAPILoaderConfigLiteral):
185185
Provider {
186-
return provide(LazyMapsAPILoaderConfig, {
186+
return {
187+
provide: LazyMapsAPILoaderConfig,
187188
useFactory: () => {
188189
const config = new LazyMapsAPILoaderConfig();
189190
// todo(sebastian): deprecate LazyMapsAPILoader class
@@ -198,5 +199,5 @@ export function provideLazyMapsAPILoaderConfig(confLiteral: LazyMapsAPILoaderCon
198199
config.region = config.region || DEFAULT_CONFIGURATION.region;
199200
return config;
200201
}
201-
});
202+
};
202203
}

src/core/utils/browser-globals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {OpaqueToken, Provider, provide} from '@angular/core';
1+
import {OpaqueToken, Provider} from '@angular/core';
22

33
export const WINDOW_GLOBAL = new OpaqueToken('angular2-google-maps window_global');
44
export const DOCUMENT_GLOBAL = new OpaqueToken('angular2-google-maps document_global');
55

66
export const BROWSER_GLOBALS_PROVIDERS: Provider[] =
7-
[provide(WINDOW_GLOBAL, {useValue: window}), provide(DOCUMENT_GLOBAL, {useValue: document})];
7+
[{provide: WINDOW_GLOBAL, useValue: window}, {provide: DOCUMENT_GLOBAL, useValue: document}];

test/services/managers/marker-manager.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {NgZone} from '@angular/core';
2-
import {addProviders, async, inject} from '@angular/core/testing';
2+
import {TestBed, async, inject} from '@angular/core/testing';
33

44
import {SebmGoogleMapMarker} from '../../../src/core/directives/google-map-marker';
55
import {GoogleMapsAPIWrapper} from '../../../src/core/services/google-maps-api-wrapper';
@@ -9,13 +9,15 @@ import {MarkerManager} from '../../../src/core/services/managers/marker-manager'
99
export function main() {
1010
describe('MarkerManager', () => {
1111
beforeEach(() => {
12-
addProviders([
13-
{provide: NgZone, useFactory: () => new NgZone({enableLongStackTrace: true})},
14-
MarkerManager, SebmGoogleMapMarker, {
15-
provide: GoogleMapsAPIWrapper,
16-
useValue: jasmine.createSpyObj('GoogleMapsAPIWrapper', ['createMarker'])
17-
}
18-
]);
12+
TestBed.configureTestingModule({
13+
providers: [
14+
{provide: NgZone, useFactory: () => new NgZone({enableLongStackTrace: true})},
15+
MarkerManager, SebmGoogleMapMarker, {
16+
provide: GoogleMapsAPIWrapper,
17+
useValue: jasmine.createSpyObj('GoogleMapsAPIWrapper', ['createMarker'])
18+
}
19+
]
20+
});
1921
});
2022

2123
describe('Create a new marker', () => {

test/services/managers/polyline-manager.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {NgZone} from '@angular/core';
2-
import {addProviders, inject} from '@angular/core/testing';
2+
import {TestBed, inject} from '@angular/core/testing';
33

44
import {SebmGoogleMapPolyline} from '../../../src/core/directives/google-map-polyline';
55
import {GoogleMapsAPIWrapper} from '../../../src/core/services/google-maps-api-wrapper';
@@ -9,13 +9,15 @@ import {PolylineManager} from '../../../src/core/services/managers/polyline-mana
99
export function main() {
1010
describe('PolylineManager', () => {
1111
beforeEach(() => {
12-
addProviders([
13-
{provide: NgZone, useFactory: () => new NgZone({enableLongStackTrace: true})},
14-
PolylineManager, SebmGoogleMapPolyline, {
15-
provide: GoogleMapsAPIWrapper,
16-
useValue: jasmine.createSpyObj('GoogleMapsAPIWrapper', ['createPolyline'])
17-
}
18-
]);
12+
TestBed.configureTestingModule({
13+
providers: [
14+
{provide: NgZone, useFactory: () => new NgZone({enableLongStackTrace: true})},
15+
PolylineManager, SebmGoogleMapPolyline, {
16+
provide: GoogleMapsAPIWrapper,
17+
useValue: jasmine.createSpyObj('GoogleMapsAPIWrapper', ['createPolyline'])
18+
}
19+
]
20+
});
1921
});
2022

2123
describe('Create a new polyline', () => {

test/services/maps-api-loader/lazy-maps-api-loader.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {addProviders, inject} from '@angular/core/testing';
1+
import {TestBed, inject} from '@angular/core/testing';
22

33
import {LazyMapsAPILoader} from '../../../src/core/services/maps-api-loader/lazy-maps-api-loader';
44
import {MapsAPILoader} from '../../../src/core/services/maps-api-loader/maps-api-loader';
@@ -7,13 +7,15 @@ import {DOCUMENT_GLOBAL, WINDOW_GLOBAL} from '../../../src/core/utils/browser-gl
77
export function main() {
88
describe('Service: LazyMapsAPILoader', () => {
99
beforeEach(() => {
10-
addProviders([
11-
{provide: MapsAPILoader, useClass: LazyMapsAPILoader},
12-
{provide: WINDOW_GLOBAL, useValue: {}}, {
13-
provide: DOCUMENT_GLOBAL,
14-
useValue: jasmine.createSpyObj<Document>('Document', ['createElement'])
15-
}
16-
]);
10+
TestBed.configureTestingModule({
11+
providers: [
12+
{provide: MapsAPILoader, useClass: LazyMapsAPILoader},
13+
{provide: WINDOW_GLOBAL, useValue: {}}, {
14+
provide: DOCUMENT_GLOBAL,
15+
useValue: jasmine.createSpyObj<Document>('Document', ['createElement'])
16+
}
17+
]
18+
});
1719
});
1820

1921
it('should create the default script URL',

0 commit comments

Comments
 (0)