main.ts 2.33 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
<div class="row">
  <div class="col-md-3">
    <ul class="nav nav-pills nav-stacked">
    <li [ngClass]="{active: path=='course-fields-select'}">
      <a [routerLink]="['/course-fields-select']">Επιλογή Ειδικότητας</a>
    </li>
    <li [ngClass]="{active: path=='region-schools-select'}">
      <a [routerLink]="['/region-schools-select']">Επιλογή Σχολείου</a>
    </li>
    <li [ngClass]="{active: path=='student-application-form-main'}">
      <a [routerLink]="['/student-application-form-main']">Αίτηση μαθητή / Καταχώρηση προσωπικών στοιχείων</a>
    </li>
    <li [ngClass]="{active: path=='students-list'}">
      <a [routerLink]="['/students-list']">Μαθητές</a>
    </li>
    <li [ngClass]="{active: path=='form3'}">
      <a [routerLink]="['/form3']">Αίτηση</a>
    </li>
    </ul>
  </div>
  <div class="col-md-9">
    <div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">{{path || 'home' | camelcase }}</h3>
      </div>
      <div class="panel-body">
        <router-outlet></router-outlet>
      </div>
    </div>
  </div>
</div>
*/
52
53
54
55

@Component({
  selector: 'main',
  template: `
56
57
58
59
  <reg-header></reg-header>
  <reg-navbar></reg-navbar>
  <reg-main></reg-main>
  <reg-footer></reg-footer>
60
61
62
63
  `
})
export default class Main {
  public path: string = '';
64
  public pathSchool: string = 'school';
65
66
67

  constructor(
    private router: Router,
68
69
70
    private activatedRoute: ActivatedRoute,
    private _ngRedux: NgRedux<IAppState>,
    private _devTools: DevToolsExtension
71
72
73
  ) {
    router.events.subscribe((data) => {
      this.path = data.url.substr(1);
74
      this.pathSchool = data.url.substr(1);
75
76
    });

77
78

    const tools = _devTools.enhancer({
79
80
//      deserializeState: reimmutify,
  });
81
82
83
84
85
    _ngRedux.configureStore(
      rootReducer,
      {},
      middleware,
//      tools ? [ ...enhancers, tools ] : enhancers);
86
87
//      tools);
      );
88
  }
89
}