main.ts 1.08 KB
Newer Older
1
2
3
4
5
6
7
8
import { Component, Inject, OnInit, OnDestroy }
 from '@angular/core';
import {
  Router,
  ActivatedRoute,
}
 from '@angular/router';
import './globalstyles.css';
9
//import '../../myschool/main.scss';
10
11
12
13
14
import { DevToolsExtension, NgRedux, select } from 'ng2-redux';
import {
  IAppState,
  rootReducer,
  middleware,
15
//  enhancers,
16
} from '../store';
17
// import { reimmutify } from '../store';
18

19
20
21
22

@Component({
  selector: 'main',
  template: `
23
24
25
26
  <reg-header></reg-header>
  <reg-navbar></reg-navbar>
  <reg-main></reg-main>
  <reg-footer></reg-footer>
27
28
29
30
31
32
33
  `
})
export default class Main {
  public path: string = '';

  constructor(
    private router: Router,
34
35
36
    private activatedRoute: ActivatedRoute,
    private _ngRedux: NgRedux<IAppState>,
    private _devTools: DevToolsExtension
37
38
39
40
41
  ) {
    router.events.subscribe((data) => {
      this.path = data.url.substr(1);
    });

42
43

    const tools = _devTools.enhancer({
44
45
//      deserializeState: reimmutify,
  });
46
47
48
49
50
51
52
    _ngRedux.configureStore(
      rootReducer,
      {},
      middleware,
//      tools ? [ ...enhancers, tools ] : enhancers);
      tools);
  }
53
}