8000 fix(core): Upgrate to RC6 · angulartics/angulartics2@5c89f50 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 5c89f50

Browse files
committed
fix(core): Upgrate to RC6
1 parent ef410c1 commit 5c89f50

19 files changed

+592
-515
lines changed

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,31 @@ Bootstrapping the application with ```Angulartics2``` as provider and injecting
4646

4747
```js
4848
// component
49+
import {Angulartics2} from 'angulartics2/src/core/angulartics2';
4950
import {Angulartics2GoogleAnalytics} from 'angulartics2/src/providers/angulartics2-google-analytics';
5051
import {Component} from '@angular/core';
5152

5253
@Component({
5354
selector: 'app',
54-
providers: [Angulartics2GoogleAnalytics],
55-
template: `<router-outlet></router-outlet>` // Or what your root template is.
55+
template: `<router-outlet></router-outlet>` // Or what your root template is.
5656
})
5757
export class AppComponent {
5858
constructor(angulartics2: Angulartics2, angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics) {}
5959
}
6060

6161
// bootstrap
62-
import {bootstrap} from '@angular/platform-browser-dynamic';
63-
import {ROUTER_PROVIDERS} from '@angular/router';
64-
65-
import {Angulartics2} from 'angulartics2';
62+
import {Angulartics2} from 'angulartics2/src/core/angulartics2';
63+
import {Angulartics2GoogleAnalytics} from 'angulartics2/src/providers/angulartics2-google-analytics';
6664

67-
bootstrap(AppComponent, [
68-
ROUTER_PROVIDERS,
69-
Angulartics2
70-
]);
65+
@NgModule({
66+
imports: [ BrowserModule, RouterModule.forRoot(routes)],
67+
declarations: [ AppComponent ],
68+
bootstrap: [ AppComponent ],
69+
providers: [
70+
Angulartics2,
71+
Angulartics2GoogleAnalytics
72+
],
73+
})
7174
```
7275

7376

@@ -77,15 +80,25 @@ To track events you can inject the directive ```angulartics2On``` into any compo
7780

7881

7982
```js
80-
import {Angulartics2On} from 'angulartics2';
8183
import {Component} from '@angular/core';
8284

8385
@Component({
8486
selector: 'song-download-box',
85-
directives: [Angulartics2On],
8687
template: `<div angulartics2On="click" angularticsEvent="DownloadClick" angularticsCategory="{{ song.name }}"></div>`,
8788
})
8889
export class SongDownloadBox {}
90+
91+
// bootstrap
92+
import {Angulartics2, Angulartics2On} from 'angulartics2/src/core/angulartics2';
93+
94+
@NgModule({
95+
imports: [ BrowserModule, RouterModule.forRoot(routes)],
96+
declarations: [ AppComponent, SongDownloadBox, Angulartics2On ],
97+
bootstrap: [ AppComponent ],
98+
providers: [
99+
Angulartics2
100+
],
101+
})
89102
```
90103

91104

karma-test-shim.js

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,40 @@ System.config({
2626

2727
System.config({
2828
defaultJSExtensions: true,
29+
paths: {
30+
// paths serve as alias
31+
'npm:': 'node_modules/'
32+
},
2933
map: {
30-
'rxjs': 'node_modules/rxjs',
31-
'@angular': 'node_modules/@angular'
34+
// angular bundles
35+
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
36+
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
37+
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
38+
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
39+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
40+
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
41+
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
42+
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
43+
44+
// angular testing umd bundles
45+
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
46+
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
47+
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
48+
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
49+
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
50+
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
51+
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
52+
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
53+
54+
// other libraries
55+
'rxjs': 'npm:rxjs',
56+
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
3257
},
3358
packages: {
34-
'@angular/core': {
35-
main: 'index.js',
36-
defaultExtension: 'js'
37-
},
38-
'@angular/compiler': {
39-
main: 'index.js',
40-
defaultExtension: 'js'
41-
},
42-
'@angular/common': {
43-
main: 'index.js',
44-
defaultExtension: 'js'
45-
},
46-
'@angular/http': {
47-
main: 'index.js',
59+
rxjs: {
4860
defaultExtension: 'js'
4961
},
50-
'@angular/platform-browser': {
51-
main: 'index.js',
52-
defaultExtension: 'js'
53-
},
54-
'@angular/platform-browser-dynamic': {
55-
main: 'index.js',
56-
defaultExtension: 'js'
57-
},
58-
'@angular/router-deprecated': {
59-
main: 'index.js',
60-
defaultExtension: 'js'
61-
},
62-
'@angular/router': {
63-
main: 'index.js',
64-
defaultExtension: 'js'
65-
},
66-
'rxjs': {
62+
'angular2-in-memory-web-api': {
6763
defaultExtension: 'js'
6864
}
6965
}
@@ -73,12 +69,11 @@ Promise.all([
7369
System.import('@angular/core/testing'),
7470
System.import('@angular/platform-browser-dynamic/testing')
7571
]).then(function (providers) {
76-
debugger;
77-
var testing = providers[0];
78-
var testingBrowser = providers[1];
79-
80-
testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
81-
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
72+
var coreTesting = providers[0];
73+
var browserTesting = providers[1];
74+
coreTesting.TestBed.initTestEnvironment(
75+
browserTesting.BrowserDynamicTestingModule,
76+
browserTesting.platformBrowserDynamicTesting());
8277

8378
}).then(function() {
8479
return Promise.all(

karma.conf.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ module.exports = function(config) {
1313

1414
// list of files / patterns to load in the browser
1515
files: [
16-
// Polyfills.
17-
'node_modules/es6-shim/es6-shim.js',
18-
19-
'node_modules/reflect-metadata/Reflect.js',
20-
21-
// System.js for module loading
22-
'node_modules/systemjs/dist/system-polyfills.js',
16+
// System.js for module loading
2317
'node_modules/systemjs/dist/system.src.js',
2418

25-
// Zone.js dependencies
19+
// Polyfills
20+
'node_modules/core-js/client/shim.js',
21+
22+
// Reflect and Zone.js
23+
'node_modules/reflect-metadata/Reflect.js',
2624
'node_modules/zone.js/dist/zone.js',
25+
'node_modules/zone.js/dist/long-stack-trace-zone.js',
26+
'node_modules/zone.js/dist/proxy.js',
27+
'node_modules/zone.js/dist/sync-test.js',
2728
'node_modules/zone.js/dist/jasmine-patch.js',
2829
'node_modules/zone.js/dist/async-test.js',
2930
'node_modules/zone.js/dist/fake-async-test.js',
@@ -32,14 +33,13 @@ module.exports = function(config) {
3233
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
3334
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
3435

35-
// paths loa 528C ded via module imports
36-
// Angular itself
37-
{ pattern: 'node_modules/@angular/**/*.js', included: false, watched: true },
36+
// Angular 2 itself and the testing library
37+
{ pattern: 'node_modules/@angular/**/*.js', included: false, watched: false },
38+
{ pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false },
3839

39-
{ pattern: 'src/**/*.ts', included: false, watched: true },
40-
{ pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false }, // PhantomJS2 (and possibly others) might require it
40+
'karma-test-shim.js',
4141

42-
'karma-test-shim.js'
42+
{ pattern: 'src/**/*.ts', included: false, watched: true },
4343
],
4444

4545
// list of files to exclude
@@ -53,9 +53,6 @@ module.exports = function(config) {
5353

5454
typescriptPreprocessor: {
5555
options: require('./tsconfig.json').compilerOptions,
56-
typings: [
57-
"typings/index.d.ts"
58-
]
5956
},
6057

6158
customLaunchers: {

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,29 @@
3535
],
3636
"dependencies": {},
3737
"devDependencies": {
38-
"@angular/common": "^2.0.0-rc.2",
39-
"@angular/compiler": "^2.0.0-rc.2",
40-
"@angular/core": "^2.0.0-rc.2",
41-
"@angular/platform-browser": "^2.0.0-rc.2",
42-
"@angular/platform-browser-dynamic": "^2.0.0-rc.2",
43-
"@angular/router": "^3.0.0-alpha.7",
38+
"@angular/common": "^2.0.0-rc.6",
39+
"@angular/compiler": "^2.0.0-rc.6",
40+
"@angular/core": "^2.0.0-rc.6",
41+
"@angular/platform-browser": "^2.0.0-rc.6",
42+
"@angular/platform-browser-dynamic": "^2.0.0-rc.6",
43+
"@angular/router": "^3.0.0-rc.2",
44+
"@types/core-js": "^0.9.28",
45+
"@types/jasmine": "^2.2.29",
4446
"commitizen": "^2.8.1",
47+
"core-js": "^2.4.0",
4548
"cz-conventional-changelog": "^1.1.6",
46-
"es6-shim": "^0.35.0",
4749
"jasmine-core": "^2.4.1",
4850
"karma": "^0.13.22",
4951
"karma-chrome-launcher": "^1.0.1",
5052
"karma-jasmine": "^1.0.2",
5153
"karma-typescript-preprocessor": "0.0.21",
52-
"reflect-metadata": "0.1.2",
53-
"rxjs": "5.0.0-beta.6",
54+
"reflect-metadata": "0.1.3",
55+
"rxjs": "5.0.0-beta.11",
5456
"semantic-release": "^4.3.5",
5557
"systemjs": "^0.19.26",
5658
"tslint": "^3.6.0",
57-
"typescript": "^1.8.10",
58-
"typings": "^1.3.0",
59-
"zone.js": "0.6.12"
59+
"typescript": "2.0.2",
60+
"zone.js": "0.6.17"
6061
},
6162
"bugs": {
6263
"url": "http://github.com/angulartics/angulartics2/issues"
@@ -65,7 +66,7 @@
6566
"lint": "tslint ./*.ts ./src/{,*/}*.ts",
6667
"test": "karma start",
6768
"commit": "git-cz",
68-
"build": "typings install && tsc -d",
69+
"build": "tsc -d",
6970
"semantic-release": "semantic-release pre && npm run build && npm publish && semantic-release post"
7071
},
7172
"main": "./index",

0 commit comments

Comments
 (0)
0