Skip to content

Commit 93e922f

Browse files
committed
chore: upgrade to angular 2.0.0-rc.1
- Upgrade to angular 2.0.0-rc.1 Closes ng-bootstrap#186
1 parent a7371be commit 93e922f

23 files changed

+96
-113
lines changed

karma-test-shim.js

+18-12
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
77
// // we will call `__karma__.start()` later, once all the specs are loaded.
88
__karma__.loaded = function() {};
99

10+
System.config({baseURL: '/base'});
11+
1012
System.config({
13+
map: {'rxjs': 'node_modules/rxjs', '@angular': 'node_modules/@angular', 'temp': 'temp'},
1114
packages: {
12-
'base/temp': {
13-
defaultExtension: false,
14-
format: 'cjs',
15-
map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
16-
}
15+
'temp': {main: 'core.js', defaultExtension: 'js'},
16+
'@angular/core': {main: 'index.js', defaultExtension: 'js'},
17+
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
18+
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
19+
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
20+
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
21+
'rxjs': {defaultExtension: 'js'}
1722
}
1823
});
1924

20-
System.import('angular2/testing')
21-
.then(function(testing) {
22-
return System.import('angular2/platform/testing/browser').then(function(testing_platform_browser) {
23-
testing.setBaseTestProviders(
24-
testing_platform_browser.TEST_BROWSER_PLATFORM_PROVIDERS,
25-
testing_platform_browser.TEST_BROWSER_APPLICATION_PROVIDERS);
26-
});
25+
Promise.all([System.import('@angular/core/testing'), System.import('@angular/platform-browser-dynamic/testing')])
26+
.then(function(providers) {
27+
var testing = providers[0];
28+
var testingBrowser = providers[1];
29+
30+
testing.setBaseTestProviders(
31+
testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
32+
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
2733
})
2834
.then(function() { return Promise.all(resolveTestFiles()); })
2935
.then(function() { __karma__.start(); }, function(error) { __karma__.error(error.stack || error); });

karma.conf.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ module.exports = function(config) {
88
files: [
99
// For travis
1010
'node_modules/es6-shim/es6-shim.js',
11+
'node_modules/reflect-metadata/Reflect.js',
1112
// paths loaded by Karma
12-
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
13-
{pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false},
14-
{pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false},
15-
{pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false},
16-
{pattern: 'node_modules/angular2/bundles/angular2.js', included: true, watched: true},
17-
{pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: true},
13+
'node_modules/systemjs/dist/system-polyfills.js',
14+
'node_modules/systemjs/dist/system.src.js',
15+
'node_modules/zone.js/dist/zone.js',
16+
'node_modules/zone.js/dist/jasmine-patch.js',
17+
'node_modules/zone.js/dist/async-test.js',
18+
'node_modules/zone.js/dist/fake-async-test.js',
19+
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
20+
{pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
1821
{pattern: 'karma-test-shim.js', included: true, watched: true},
22+
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: true},
23+
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: true},
1924

2025
// paths loaded via module imports
2126
{pattern: 'temp/**/*.js', included: false, watched: true},

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
},
2020
"homepage": "https://github.com/ng-bootstrap/core#readme",
2121
"devDependencies": {
22-
"angular2": "2.0.0-beta.17",
22+
"@angular/common": "2.0.0-rc.1",
23+
"@angular/compiler": "2.0.0-rc.1",
24+
"@angular/core": "2.0.0-rc.1",
25+
"@angular/platform-browser": "2.0.0-rc.1",
26+
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
2327
"clang-format": "1.0.35",
2428
"del": "^2.0.2",
2529
"es6-shim": "^0.35.0",
@@ -43,7 +47,7 @@
4347
"reflect-metadata": "0.1.2",
4448
"run-sequence": "^1.1.4",
4549
"rxjs": "5.0.0-beta.6",
46-
"systemjs": "^0.19.5",
50+
"systemjs": "^0.19.26",
4751
"ts-loader": "^0.8.1",
4852
"typescript": "^1.6.2",
4953
"typings": "^0.7.9",

src/accordion/accordion.spec.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import {
2-
iit,
3-
it,
4-
ddescribe,
5-
describe,
6-
expect,
7-
inject,
8-
async,
9-
TestComponentBuilder,
10-
beforeEachProviders
11-
} from 'angular2/testing';
12-
13-
import {Component} from 'angular2/core';
1+
import {iit, it, ddescribe, describe, expect, inject, async, beforeEachProviders} from '@angular/core/testing';
2+
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
4+
5+
import {Component} from '@angular/core';
146

157
import {NgbAccordion, NgbPanel} from './accordion';
168

src/accordion/accordion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ContentChildren,
88
AfterContentChecked,
99
Optional
10-
} from 'angular2/core';
10+
} from '@angular/core';
1111

1212
import {NgbCollapse} from '../collapse/collapse';
1313

src/accordion/panel.spec.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import {
2-
iit,
3-
it,
4-
ddescribe,
5-
describe,
6-
expect,
7-
inject,
8-
injectAsync,
9-
TestComponentBuilder,
10-
beforeEachProviders
11-
} from 'angular2/testing';
12-
13-
import {Component} from 'angular2/core';
1+
import {iit, it, ddescribe, describe, expect, inject, injectAsync, beforeEachProviders} from '@angular/core/testing';
2+
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
4+
5+
import {Component} from '@angular/core';
146

157
import {NgbPanel} from './accordion';
168

src/alert/alert.spec.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
import {
2-
iit,
3-
it,
4-
ddescribe,
5-
describe,
6-
expect,
7-
inject,
8-
async,
9-
TestComponentBuilder,
10-
} from 'angular2/testing';
11-
12-
import {Component} from 'angular2/core';
1+
import {iit, it, ddescribe, describe, expect, inject, async} from '@angular/core/testing';
2+
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
4+
5+
import {Component} from '@angular/core';
136

147
import {NgbAlert} from './alert';
158

src/alert/alert.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy} from 'angular2/core';
1+
import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy} from '@angular/core';
22

33
@Component({
44
selector: 'ngb-alert',

src/collapse/collapse.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import {
66
expect,
77
inject,
88
async,
9-
TestComponentBuilder,
10-
} from 'angular2/testing';
9+
} from '@angular/core/testing';
1110

12-
import {Component} from 'angular2/core';
11+
import {TestComponentBuilder} from '@angular/compiler/testing';
12+
13+
import {Component} from '@angular/core';
1314

1415
import {NgbCollapse} from './collapse';
1516

src/collapse/collapse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Directive, Input} from 'angular2/core';
1+
import {Directive, Input} from '@angular/core';
22

33
@Directive({
44
selector: '[ngbCollapse]',

src/dropdown/dropdown.spec.ts

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
import {
2-
iit,
3-
it,
4-
ddescribe,
5-
describe,
6-
expect,
7-
inject,
8-
async,
9-
TestComponentBuilder,
10-
beforeEachProviders
11-
} from 'angular2/testing';
12-
13-
import {Component} from 'angular2/core';
14-
import {By} from 'angular2/platform/browser';
1+
import {iit, it, ddescribe, describe, expect, inject, async, beforeEachProviders} from '@angular/core/testing';
2+
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
4+
5+
import {Component} from '@angular/core';
6+
import {By} from '@angular/platform-browser';
157

168
import {NgbDropdown, NgbDropdownToggle} from './dropdown';
179

src/dropdown/dropdown.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Directive, Input, HostListener} from 'angular2/core';
1+
import {Directive, Input, HostListener} from '@angular/core';
22

33
@Directive(
44
{selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: {'[class.open]': 'open', '(keyup.esc)': 'close()'}})

src/pager/pager.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import {
66
expect,
77
inject,
88
async,
9-
TestComponentBuilder,
109
beforeEach,
1110
beforeEachProviders
12-
} from 'angular2/testing';
11+
} from '@angular/core/testing';
1312

14-
import {Component} from 'angular2/core';
13+
import {TestComponentBuilder} from '@angular/compiler/testing';
14+
15+
import {Component} from '@angular/core';
1516

1617
import {NgbPager} from './pager';
1718

src/pager/pager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ChangeDetectionStrategy, OnChanges, Input, Output, EventEmitter} from 'angular2/core';
1+
import {Component, ChangeDetectionStrategy, OnChanges, Input, Output, EventEmitter} from '@angular/core';
22

33
@Component({
44
selector: 'ngb-pager',

src/pagination/pagination.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import {
66
expect,
77
inject,
88
async,
9-
TestComponentBuilder,
109
beforeEach,
1110
beforeEachProviders
12-
} from 'angular2/testing';
11+
} from '@angular/core/testing';
1312

14-
import {Component} from 'angular2/core';
13+
import {TestComponentBuilder} from '@angular/compiler/testing';
14+
15+
import {Component} from '@angular/core';
1516

1617
import {NgbPagination} from './pagination';
1718

src/pagination/pagination.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, EventEmitter, Input, Output, OnChanges, ChangeDetectionStrategy} from 'angular2/core';
1+
import {Component, EventEmitter, Input, Output, OnChanges, ChangeDetectionStrategy} from '@angular/core';
22
import {getValueInRange, toInteger} from '../util/util';
33

44
@Component({

src/progressbar/progressbar.spec.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import {iit, it, ddescribe, describe, expect, inject, async, TestComponentBuilder} from 'angular2/testing';
1+
import {iit, it, ddescribe, describe, expect, inject, async} from '@angular/core/testing';
22

3-
import {Component} from 'angular2/core';
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
44

5-
import {NgbProgressbar} from "./progressbar";
5+
import {Component} from '@angular/core';
6+
7+
import {NgbProgressbar} from './progressbar';
68

79
function getBarWidth(nativeEl): string {
810
return nativeEl.querySelector('.progress-bar').style.width;

src/progressbar/progressbar.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Input, ChangeDetectionStrategy} from 'angular2/core';
1+
import {Component, Input, ChangeDetectionStrategy} from '@angular/core';
22
import {getValueInRange, toBoolean} from '../util/util';
33

44
@Component({

src/rating/rating.spec.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import {
2-
iit,
3-
it,
4-
ddescribe,
5-
describe,
6-
expect,
7-
inject,
8-
async,
9-
TestComponentBuilder,
10-
beforeEachProviders
11-
} from 'angular2/testing';
12-
13-
import {Component} from 'angular2/core';
1+
import {iit, it, ddescribe, describe, expect, inject, async, beforeEachProviders} from '@angular/core/testing';
2+
3+
import {TestComponentBuilder} from '@angular/compiler/testing';
4+
5+
import {Component} from '@angular/core';
146

157
import {NgbRating} from './rating';
168

src/rating/rating.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Input, Output, EventEmitter, OnInit} from 'angular2/core';
1+
import {Component, Input, Output, EventEmitter, OnInit} from '@angular/core';
22

33
@Component({
44
selector: 'ngb-rating',

src/tabset/tabset.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import {
66
expect,
77
inject,
88
async,
9-
TestComponentBuilder,
109
beforeEach,
1110
beforeEachProviders
12-
} from 'angular2/testing';
11+
} from '@angular/core/testing';
1312

14-
import {Component} from 'angular2/core';
13+
import {TestComponentBuilder} from '@angular/compiler/testing';
14+
15+
import {Component} from '@angular/core';
1516

1617
import {NgbTabset, NgbTab, NgbTabContent, NgbTabTitle} from './tabset';
1718

src/tabset/tabset.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import {
77
TemplateRef,
88
ContentChild,
99
AfterContentChecked
10-
} from 'angular2/core';
10+
} from '@angular/core';
1111

1212
@Directive({selector: 'template[ngb-tab-title]'})
1313
export class NgbTabTitle {
14-
constructor(public templateRef: TemplateRef) {}
14+
constructor(public templateRef: TemplateRef<any>) {}
1515
}
1616

1717
@Directive({selector: 'template[ngb-tab-content]'})
1818
export class NgbTabContent {
19-
constructor(public templateRef: TemplateRef) {}
19+
constructor(public templateRef: TemplateRef<any>) {}
2020
}
2121

2222
@Directive({selector: 'ngb-tab'})

src/util/util.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import {
66
expect,
77
inject,
88
injectAsync,
9-
TestComponentBuilder,
109
beforeEach,
1110
beforeEachProviders
12-
} from 'angular2/testing';
11+
} from '@angular/core/testing';
12+
13+
import {TestComponentBuilder} from '@angular/compiler/testing';
1314

1415
import {toBoolean, toInteger, getValueInRange} from './util';
1516

0 commit comments

Comments
 (0)