mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore: update to angular rc3 & newest router (#729)
This commit is contained in:
+7
-7
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
@@ -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: `
|
||||
@@ -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 { }
|
||||
|
||||
@@ -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);
|
||||
@@ -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}}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
@@ -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',
|
||||
@@ -35,8 +33,4 @@ export class Home {}
|
||||
],
|
||||
pipes: []
|
||||
})
|
||||
@Routes([
|
||||
new Route({path: '/', component: Home}),
|
||||
new Route({path: '/button', component: ButtonE2E})
|
||||
])
|
||||
export class E2EApp { }
|
||||
|
||||
@@ -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);
|
||||
@@ -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>
|
||||
|
||||
+2
-2
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user