Skip to content

Commit

Permalink
chore: update to angular rc3 & newest router (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn authored Jun 28, 2016
1 parent 3ccb23e commit 02cee7b
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 72 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"node": ">= 4.2.1 < 5"
},
"dependencies": {
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/common": "2.0.0-rc.3",
"@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3",
"@angular/http": "2.0.0-rc.3",
"@angular/platform-browser": "2.0.0-rc.3",
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
"@angular/router": "v3.0.0-alpha.8",
"core-js": "^2.4.0",
"hammerjs": "^2.0.8",
"rxjs": "5.0.0-beta.6",
Expand Down
2 changes: 1 addition & 1 deletion src/components/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular/http": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.3",
"@angular2-material/core": "2.0.0-alpha.5-2"
}
}
8 changes: 5 additions & 3 deletions src/components/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ export class MdTabGroup {
private _selectedIndex: number = 0;
@Input()
set selectedIndex(value: number) {
this._selectedIndex = value;
if (value != this._selectedIndex) {
this._selectedIndex = value;

if (this._isInitialized) {
this._onSelectChange.emit(this._createChangeEvent(value));
if (this._isInitialized) {
this._onSelectChange.emit(this._createChangeEvent(value));
}
}
}
get selectedIndex(): number {
Expand Down
4 changes: 2 additions & 2 deletions src/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular/core": "^2.0.0-rc.1",
"@angular/common": "^2.0.0-rc.1"
"@angular/core": "^2.0.0-rc.3",
"@angular/common": "^2.0.0-rc.3"
}
}
47 changes: 1 addition & 46 deletions src/demo-app/demo-app/demo-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {Route, Routes, ROUTER_DIRECTIVES} from '@angular/router';
import {ROUTER_DIRECTIVES} from '@angular/router';

import {Dir} from '@angular2-material/core/rtl/dir';
import {MdButton} from '@angular2-material/button/button';
Expand All @@ -8,27 +8,6 @@ import {MD_LIST_DIRECTIVES} from '@angular2-material/list/list';
import {MdIcon} from '@angular2-material/icon/icon';
import {MdToolbar} from '@angular2-material/toolbar/toolbar';

import {CardDemo} from '../card/card-demo';
import {BaselineDemo} from '../baseline/baseline-demo';
import {ButtonDemo} from '../button/button-demo';
import {IconDemo} from '../icon/icon-demo';
import {RadioDemo} from '../radio/radio-demo';
import {SidenavDemo} from '../sidenav/sidenav-demo';
import {ProgressBarDemo} from '../progress-bar/progress-bar-demo';
import {ProgressCircleDemo} from '../progress-circle/progress-circle-demo';
import {CheckboxDemo} from '../checkbox/checkbox-demo';
import {PortalDemo} from '../portal/portal-demo';
import {ToolbarDemo} from '../toolbar/toolbar-demo';
import {OverlayDemo} from '../overlay/overlay-demo';
import {ListDemo} from '../list/list-demo';
import {InputDemo} from '../input/input-demo';
import {LiveAnnouncerDemo} from '../live-announcer/live-announcer-demo';
import {GesturesDemo} from '../gestures/gestures-demo';
import {GridListDemo} from '../grid-list/grid-list-demo';
import {TabsDemo} from '../tabs/tab-group-demo';
import {SlideToggleDemo} from '../slide-toggle/slide-toggle-demo';
import {ButtonToggleDemo} from '../button-toggle/button-toggle-demo';

@Component({
selector: 'home',
template: `
Expand All @@ -55,28 +34,4 @@ export class Home {}
],
pipes: []
})
@Routes([
new Route({path: '/', component: Home}),
new Route({path: '/button', component: ButtonDemo}),
new Route({path: '/card', component: CardDemo}),
new Route({path: '/radio', component: RadioDemo}),
new Route({path: '/sidenav', component: SidenavDemo}),
new Route({path: '/slide-toggle', component: SlideToggleDemo}),
new Route({path: '/progress-circle', component: ProgressCircleDemo}),
new Route({path: '/progress-bar', component: ProgressBarDemo}),
new Route({path: '/portal', component: PortalDemo}),
new Route({path: '/overlay', component: OverlayDemo}),
new Route({path: '/checkbox', component: CheckboxDemo}),
new Route({path: '/input', component: InputDemo}),
new Route({path: '/toolbar', component: ToolbarDemo}),
new Route({path: '/icon', component: IconDemo}),
new Route({path: '/list', component: ListDemo}),
new Route({path: '/live-announcer', component: LiveAnnouncerDemo}),
new Route({path: '/gestures', component: GesturesDemo}),
new Route({path: '/grid-list', component: GridListDemo}),
new Route({path: '/tabs', component: TabsDemo}),
new Route({path: '/button-toggle', component: ButtonToggleDemo}),

new Route({path: '/baseline', component: BaselineDemo})
])
export class DemoApp { }
50 changes: 50 additions & 0 deletions src/demo-app/demo-app/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {provideRouter, RouterConfig} from '@angular/router';
import {Home} from './demo-app';
import {ButtonDemo} from '../button/button-demo';
import {BaselineDemo} from '../baseline/baseline-demo';
import {ButtonToggleDemo} from '../button-toggle/button-toggle-demo';
import {TabsDemo} from '../tabs/tab-group-demo';
import {GridListDemo} from '../grid-list/grid-list-demo';
import {GesturesDemo} from '../gestures/gestures-demo';
import {LiveAnnouncerDemo} from '../live-announcer/live-announcer-demo';
import {ListDemo} from '../list/list-demo';
import {IconDemo} from '../icon/icon-demo';
import {ToolbarDemo} from '../toolbar/toolbar-demo';
import {InputDemo} from '../input/input-demo';
import {CheckboxDemo} from '../checkbox/checkbox-demo';
import {OverlayDemo} from '../overlay/overlay-demo';
import {PortalDemo} from '../portal/portal-demo';
import {ProgressBarDemo} from '../progress-bar/progress-bar-demo';
import {ProgressCircleDemo} from '../progress-circle/progress-circle-demo';
import {SlideToggleDemo} from '../slide-toggle/slide-toggle-demo';
import {SidenavDemo} from '../sidenav/sidenav-demo';
import {RadioDemo} from '../radio/radio-demo';
import {CardDemo} from '../card/card-demo';



export const routes: RouterConfig = [
{path: '', component: Home},
{path: 'button', component: ButtonDemo},
{path: 'card', component: CardDemo},
{path: 'radio', component: RadioDemo},
{path: 'sidenav', component: SidenavDemo},
{path: 'slide-toggle', component: SlideToggleDemo},
{path: 'progress-circle', component: ProgressCircleDemo},
{path: 'progress-bar', component: ProgressBarDemo},
{path: 'portal', component: PortalDemo},
{path: 'overlay', component: OverlayDemo},
{path: 'checkbox', component: CheckboxDemo},
{path: 'input', component: InputDemo},
{path: 'toolbar', component: ToolbarDemo},
{path: 'icon', component: IconDemo},
{path: 'list', component: ListDemo},
{path: 'live-announcer', component: LiveAnnouncerDemo},
{path: 'gestures', component: GesturesDemo},
{path: 'grid-list', component: GridListDemo},
{path: 'tabs', component: TabsDemo},
{path: 'button-toggle', component: ButtonToggleDemo},
{path: 'baseline', component: BaselineDemo},
];

export const DEMO_APP_ROUTE_PROVIDER = provideRouter(routes);
2 changes: 1 addition & 1 deletion src/demo-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Material2</title>
<base href="/">
<base href=".">

{{!-- Add live-reload support, only in development. --}}
{{#unless environment.production}}
Expand Down
4 changes: 2 additions & 2 deletions src/demo-app/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {bootstrap} from '@angular/platform-browser-dynamic';
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
import {provide} from '@angular/core';
import {Renderer} from '@angular/core';

Expand All @@ -12,9 +11,10 @@ import {MdGestureConfig} from '@angular2-material/core/gestures/MdGestureConfig'
import {MdIconRegistry} from '@angular2-material/icon/icon-registry';

import {DemoApp} from './demo-app/demo-app';
import {DEMO_APP_ROUTE_PROVIDER} from './demo-app/routes';

bootstrap(DemoApp, [
ROUTER_PROVIDERS,
DEMO_APP_ROUTE_PROVIDER,
MdLiveAnnouncer,
provide(OVERLAY_CONTAINER_TOKEN, {useValue: createOverlayContainer()}),
HTTP_PROVIDERS,
Expand Down
8 changes: 1 addition & 7 deletions src/e2e-app/e2e-app/e2e-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {Route, Routes, ROUTER_DIRECTIVES} from '@angular/router';
import {ROUTER_DIRECTIVES} from '@angular/router';

import {Dir} from '@angular2-material/core/rtl/dir';
import {MdButton} from '@angular2-material/button/button';
Expand All @@ -8,8 +8,6 @@ import {MD_LIST_DIRECTIVES} from '@angular2-material/list/list';
import {MdIcon} from '@angular2-material/icon/icon';
import {MdToolbar} from '@angular2-material/toolbar/toolbar';

import {ButtonE2E} from '../button/button-e2e';


@Component({
selector: 'home',
Expand All @@ -35,8 +33,4 @@ export class Home {}
],
pipes: []
})
@Routes([
new Route({path: '/', component: Home}),
new Route({path: '/button', component: ButtonE2E})
])
export class E2EApp { }
11 changes: 11 additions & 0 deletions src/e2e-app/e2e-app/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {provideRouter, RouterConfig} from '@angular/router';
import {Home} from './e2e-app';
import {ButtonE2E} from '../button/button-e2e';


export const routes: RouterConfig = [
{path: '', component: Home},
{path: 'button', component: ButtonE2E},
];

export const E2E_APP_ROUTE_PROVIDER = provideRouter(routes);
2 changes: 1 addition & 1 deletion src/e2e-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Material2</title>
<base href="/">
<base href=".">

{{#unless environment.production}}
<script src="/ember-cli-live-reload.js" type="text/javascript"></script>
Expand Down
4 changes: 2 additions & 2 deletions src/e2e-app/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {bootstrap} from '@angular/platform-browser-dynamic';
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
import {provide} from '@angular/core';
import {Renderer} from '@angular/core';

Expand All @@ -12,9 +11,10 @@ import {MdGestureConfig} from '@angular2-material/core/gestures/MdGestureConfig'
import {MdIconRegistry} from '@angular2-material/icon/icon-registry';

import {E2EApp} from './e2e-app/e2e-app';
import {E2E_APP_ROUTE_PROVIDER} from './e2e-app/routes';

bootstrap(E2EApp, [
ROUTER_PROVIDERS,
E2E_APP_ROUTE_PROVIDER,
MdLiveAnnouncer,
provide(OVERLAY_CONTAINER_TOKEN, {useValue: createOverlayContainer()}),
HTTP_PROVIDERS,
Expand Down

0 comments on commit 02cee7b

Please sign in to comment.