main.ts 1.13 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 18 19 20

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

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

42 43

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