Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
e-epal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
5538e078
Commit
5538e078
authored
Apr 28, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trans
parent
2eddb0e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
source/components/infoviews/perfecture-view.ts
source/components/infoviews/perfecture-view.ts
+97
-0
No files found.
source/components/infoviews/perfecture-view.ts
0 → 100644
View file @
5538e078
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
'
;
import
{
NgRedux
,
select
}
from
'
ng2-redux
'
;
import
{
IAppState
}
from
'
../../store/store
'
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
'
@angular/router
'
;
import
{
BehaviorSubject
,
Subscription
}
from
'
rxjs/Rx
'
;
import
{
ILoginInfo
}
from
'
../../store/logininfo/logininfo.types
'
;
import
{
FormBuilder
,
FormGroup
,
FormControl
,
FormArray
,
Validators
,
}
from
'
@angular/forms
'
;
@
Component
({
selector
:
'
perfecture-view
'
,
template
:
`
<ul class="list-group main-view">
<div *ngFor="let SchoolNames$ of SchoolsPerPerf$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActiveRegion(SchoolNames$.id)" [class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id ">
<h5>{{SchoolNames$.name}}</h5>
</li>
</div>
</ul>
<div class="col-md-6">
<button type="button" class="btn-primary btn-lg pull-right" (click)="navigateToApplication()" >
<i class="fa fa-forward"></i>
</button>
</div>
`
})
@
Injectable
()
export
default
class
PerfectureView
implements
OnInit
,
OnDestroy
{
public
formGroup
:
FormGroup
;
private
SchoolsPerPerf$
:
BehaviorSubject
<
any
>
;
private
SchoolPerPerfSub
:
Subscription
;
public
perfecture
=
1
;
private
regionActive
=
<
number
>-
1
;
constructor
(
private
fb
:
FormBuilder
,
private
router
:
Router
,
private
_hds
:
HelperDataService
,
)
{
this
.
SchoolsPerPerf$
=
new
BehaviorSubject
([{}]);
this
.
formGroup
=
this
.
fb
.
group
({
});
}
ngOnDestroy
()
{
}
ngOnInit
()
{
this
.
SchoolPerPerfSub
=
this
.
_hds
.
getSchoolPerPerfecture
(
this
.
perfecture
).
subscribe
(
data
=>
{
this
.
SchoolsPerPerf$
.
next
(
data
);
},
error
=>
{
this
.
SchoolsPerPerf$
.
next
([{}]);
console
.
log
(
"
Error Getting Schools
"
);
},
()
=>
console
.
log
(
"
Getting Schools
"
));
}
setActiveRegion
(
ind
)
{
console
.
log
(
ind
,
"
ind
"
);
if
(
ind
===
this
.
regionActive
)
ind
=
-
1
;
this
.
regionActive
=
ind
;
}
navigateToApplication
()
{
var
id
:
string
=
String
(
this
.
regionActive
);
this
.
router
.
navigate
([
''
,
{
ids
:
id
}]);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment