Commit 8aeadb90 authored by Open Source Developer's avatar Open Source Developer

commit

parent 71784dc4
import {Component} from '@angular/core';
import {
FormBuilder,
FormGroup,
FormControl,
FormArray
} from '@angular/forms';
@Component({
selector: 'home',
template: `
<div>
<h4>e-EPAL και e-IEK application skeleton</h4>
<h4>Στοιχεία Σύνδεσης</h4>
<form [formGroup]="formGroup">
<div class="form-group">
<label for="UserName">Όνομα Χρήστη</label><input class="form-control" type="text" formControlName="Username">
</div>
<div class="form-group">
<label for="Paswd">Κωδικός Ασφαλείας</label><input class="form-control" type="password" formControlName="Paswd">
</div>
<div class="row">
<div class="col-md-2 col-md-offset-5">
<button type="button" class="btn-primary btn-lg pull-center" (click)="checkvalidation()">
Συνέχεια<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<div *ngIf="emptyselection==true">
Παρακαλώ συμπληρώστε το ΑΜΚΑ του μαθητή
</div>
</div>
</form>
</div>
`
})
export default class Home { }
export default class Home {
public formGroup: FormGroup;
constructor(private fb: FormBuilder) {
this.formGroup = this.fb.group({
Username: [],
Paswd : []
});
};
checkvalidation() {
if (this.fb.group.arguments == 'admin')
{
}
}
\ No newline at end of file
......@@ -14,14 +14,14 @@ import {
FormArray
} from '@angular/forms';
import {AppSettings} from '../../app.settings';
@Component({
selector: 'amka-fill',
template: `
<form [formGroup]="formGroup">
<div *ngFor="let amkafill$ of amkafills$ | async;"> </div>
<div class="form-group">
<label for="studentAmka">ΑΜΚΑ μαθητή</label><input class="form-control" type="text" formControlName="name">
</div>
......@@ -31,6 +31,9 @@ import {AppSettings} from '../../app.settings';
Συνέχεια<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<div *ngIf="emptyselection==true">
Παρακαλώ συμπληρώστε το ΑΜΚΑ του μαθητή
</div>
</div>
</form>
`
......@@ -41,6 +44,7 @@ import {AppSettings} from '../../app.settings';
public formGroup: FormGroup;
private respond: any;
emptyselection = false ;
constructor(private fb: FormBuilder,
private _cas: AmkaCheckService,
......@@ -54,8 +58,7 @@ import {AppSettings} from '../../app.settings';
ngOnInit() {
// this._cfa.getEpalClasses()
console.log(this.formGroup.value);
this.amkafills$ = this._ngRedux.select(state => {
if (state.amkafills.size > 0) {
......@@ -71,8 +74,14 @@ import {AppSettings} from '../../app.settings';
saveSelected() {
if (this.formGroup.value.name == undefined) {
this.emptyselection = true;
}
else
{
this._cfa.saveAmkaFills(this.formGroup.value);
this.router.navigate(['/epal-class-select']);
}
}
}
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Rx';
import { Injectable } from "@angular/core";
......@@ -14,7 +14,6 @@ import {
} from '@angular/forms';
import {AppSettings} from '../../app.settings';
@Component({
selector: 'epal-class-select',
template: `
......
......@@ -4,6 +4,7 @@ import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map';
import { IAmkaFill } from '../store/amkafill/amkafills.types';
@Injectable()
export class AmkaCheckService {
private _url = "https://wso2.minedu.gov.gr/amka/v1.1/" ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment