director-view.ts 2.75 KB
Newer Older
Open Source Developer's avatar
Open Source Developer committed
1 2 3 4 5 6
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
Open Source Developer's avatar
tran  
Open Source Developer committed
7
import { NgRedux, select } from 'ng2-redux';
Open Source Developer's avatar
Open Source Developer committed
8 9 10
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
Open Source Developer's avatar
trans  
Open Source Developer committed
11 12 13 14 15 16 17
import {
    FormBuilder,
    FormGroup,
    FormControl,
    FormArray,
    Validators,
} from '@angular/forms';
Open Source Developer's avatar
Open Source Developer committed
18 19 20
@Component({
    selector: 'director-view',
    template: `
Open Source Developer's avatar
tran  
Open Source Developer committed
21
          
Open Source Developer's avatar
trans  
Open Source Developer committed
22 23 24 25 26 27 28 29 30 31 32
    <form [formGroup]="formGroup">
         
            <div class="form-group" style= "margin-top: 50px; margin-bottom: 100px;">
              <label for="name">Τάξη</label><br/>
                    <select class="form-control" formControlName="name" (change)="verifyclass()">
                        <option value="Α' Λυκείου">Α' Λυκείου</option>
                        <option value="Β' Λυκείου">Β' Λυκείου</option>
                        <option value="Γ' Λυκείου">Γ' Λυκείου</option>
                    </select>

           <div>
Open Source Developer's avatar
tran  
Open Source Developer committed
33
    
Open Source Developer's avatar
trans  
Open Source Developer committed
34 35 36 37 38 39
        <div class="form-group" style= "margin-top: 50px; margin-bottom: 100px;">
              <label for="name1">Τάξη1</label><br/>
                    <select class="form-control" formControlName="name1" (change)="verifyclass()">
                        <option value="Α' Λυκείου">Α' Λυκείου</option>
                        <option value="Β' Λυκείου">Β' Λυκείου</option>
                        <option value="Γ' Λυκείου">Γ' Λυκείου</option>
Open Source Developer's avatar
tran  
Open Source Developer committed
40 41
                    </select>

Open Source Developer's avatar
trans  
Open Source Developer committed
42 43 44
         <div>
    
               
Open Source Developer's avatar
Open Source Developer committed
45 46 47 48 49
   `
})

@Injectable() export default class DirectorView implements OnInit , OnDestroy{

Open Source Developer's avatar
trans  
Open Source Developer committed
50
    public formGroup: FormGroup;
Open Source Developer's avatar
Open Source Developer committed
51 52
    private StudentSelected$: BehaviorSubject<any>;
    private StudentSelectedSub: Subscription;
Open Source Developer's avatar
trans  
Open Source Developer committed
53 54 55 56
    public bClassEnabled: boolean;

    constructor(private fb: FormBuilder,
                private _hds: HelperDataService, 
Open Source Developer's avatar
Open Source Developer committed
57 58 59 60
                private activatedRoute: ActivatedRoute,
                private router: Router )
    {
       this.StudentSelected$ = new BehaviorSubject([{}]);
Open Source Developer's avatar
trans  
Open Source Developer committed
61 62 63 64
       this.formGroup = this.fb.group({
                name:[],
                name1 :[]
                 });
Open Source Developer's avatar
Open Source Developer committed
65 66 67 68 69 70 71 72
    }

    ngOnDestroy()
    {
        if (this.StudentSelectedSub)
            this.StudentSelectedSub.unsubscribe();

    }
Open Source Developer's avatar
tran  
Open Source Developer committed
73
 
Open Source Developer's avatar
Open Source Developer committed
74 75
    ngOnInit() {
     
Open Source Developer's avatar
trans  
Open Source Developer committed
76 77
       this.bClassEnabled = false;
               
Open Source Developer's avatar
Open Source Developer committed
78 79 80 81

    }


Open Source Developer's avatar
trans  
Open Source Developer committed
82 83 84 85 86
    verifyclass()
    {
       this.bClassEnabled = true;
    }

Open Source Developer's avatar
Open Source Developer committed
87 88

}