Skip to content
This repository was archived by the owner on Sep 21, 2018. It is now read-only.

Commit 89b56cc

Browse files
committed
feat(Devtools): Add store-devtools integration
1 parent a583221 commit 89b56cc

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

package.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,29 @@
2727
"npm": ">= 3"
2828
},
2929
"dependencies": {
30-
"@angular/common": "^2.0.0-rc.1",
31-
"@angular/compiler": "^2.0.0-rc.1",
32-
"@angular/core": "^2.0.0-rc.1",
33-
"@angular/http": "^2.0.0-rc.1",
34-
"@angular/platform-browser": "^2.0.0-rc.1",
35-
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
36-
"@angular2-material/button": "2.0.0-alpha.5-2",
37-
"@angular2-material/card": "2.0.0-alpha.5-2",
38-
"@angular2-material/core": "2.0.0-alpha.5-2",
39-
"@angular2-material/list": "2.0.0-alpha.5-2",
40-
"@angular2-material/icon": "2.0.0-alpha.5-2",
41-
"@angular2-material/input": "2.0.0-alpha.5-2",
42-
"@angular2-material/sidenav": "2.0.0-alpha.5-2",
43-
"@angular2-material/toolbar": "2.0.0-alpha.5-2",
30+
"@angular/common": "2.0.0-rc.4",
31+
"@angular/compiler": "2.0.0-rc.4",
32+
"@angular/core": "2.0.0-rc.4",
33+
"@angular/forms": "^0.2.0",
34+
"@angular/http": "2.0.0-rc.4",
35+
"@angular/platform-browser": "2.0.0-rc.4",
36+
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
37+
"@angular2-material/button": "2.0.0-alpha.6",
38+
"@angular2-material/card": "2.0.0-alpha.6",
39+
"@angular2-material/core": "2.0.0-alpha.6",
40+
"@angular2-material/icon": "2.0.0-alpha.6",
41+
"@angular2-material/input": "2.0.0-alpha.6",
42+
"@angular2-material/list": "2.0.0-alpha.6",
43+
"@angular2-material/sidenav": "2.0.0-alpha.6",
44+
"@angular2-material/toolbar": "2.0.0-alpha.6",
4445
"@ngrx/core": "^1.0.0",
4546
"@ngrx/db": "^1.1.0",
4647
"@ngrx/effects": "^1.0.1",
4748
"@ngrx/router": "^1.0.0-beta.1",
4849
"@ngrx/router-store": "0.0.1",
4950
"@ngrx/store": "^2.0.0",
51+
"@ngrx/store-devtools": "^2.0.0-beta.1",
52+
"@ngrx/store-log-monitor": "^2.0.0-beta.1",
5053
"core-js": "^2.2.2",
5154
"ngrx-store-logger": "^0.1.4",
5255
"normalize.css": "^4.1.1",

src/app.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MdToolbar } from '@angular2-material/toolbar';
44
import { MD_SIDENAV_DIRECTIVES } from '@angular2-material/sidenav';
55
import { MdIcon, MdIconRegistry } from '@angular2-material/icon';
66
import { MD_LIST_DIRECTIVES } from '@angular2-material/list';
7-
7+
import { StoreLogMonitorComponent } from '@ngrx/store-log-monitor';
88

99
@Component({
1010
selector: 'app',
@@ -14,7 +14,8 @@ import { MD_LIST_DIRECTIVES } from '@angular2-material/list';
1414
MdToolbar,
1515
MD_SIDENAV_DIRECTIVES,
1616
MdIcon,
17-
MD_LIST_DIRECTIVES
17+
MD_LIST_DIRECTIVES,
18+
StoreLogMonitorComponent
1819
],
1920
providers: [ MdIconRegistry ],
2021
styles: [`
@@ -29,6 +30,7 @@ import { MD_LIST_DIRECTIVES } from '@angular2-material/list';
2930
3031
md-sidenav-layout {
3132
background: rgba(0, 0, 0, .03);
33+
right: 30% !important; // Make space for the devtools, demo only
3234
}
3335
3436
md-sidenav {
@@ -61,6 +63,7 @@ import { MD_LIST_DIRECTIVES } from '@angular2-material/list';
6163
<route-view></route-view>
6264
6365
</md-sidenav-layout>
66+
<ngrx-store-log-monitor toggleCommand="ctrl-t"></ngrx-store-log-monitor>
6467
`
6568
})
6669
export default class App { }

src/main.browser.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { bootstrap } from '@angular/platform-browser-dynamic';
22
import { HashLocationStrategy } from '@angular/common';
3+
import { disableDeprecatedForms, provideForms } from '@angular/forms';
34
import { provideRouter } from '@ngrx/router';
45
import { provideStore } from '@ngrx/store';
56
import { provideDB } from '@ngrx/db';
67
import { connectRouterToStore } from '@ngrx/router-store';
78
import { runEffects } from '@ngrx/effects';
9+
import { instrumentStore } from '@ngrx/store-devtools';
10+
import { useLogMonitor } from '@ngrx/store-log-monitor';
811

912
import App from './app';
1013
import routes from './routes';
@@ -60,10 +63,23 @@ bootstrap(App, [
6063
*/
6164
provideDB(schema),
6265

66+
/**
67+
* instrumentStore() sets up the @ngrx/store-devtools providers
68+
*/
69+
instrumentStore({
70+
monitor: useLogMonitor({
71+
position: 'right',
72+
visible: true
73+
})
74+
}),
75+
6376
/**
6477
* Finall we provide additional services and action creators so they can
6578
* be used by all of our components, effects, and guards.
6679
*/
6780
services,
68-
actions
81+
actions,
82+
83+
disableDeprecatedForms(),
84+
provideForms()
6985
]);

0 commit comments

Comments
 (0)