Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 84446692
authored
Mar 31, 2018
by
Riina Antikainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selector WORKING
1 parent
40dac320
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
12 deletions
code/moya-management-portal/src/app/app.component.html
code/moya-management-portal/src/app/app.component.ts
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
code/moya-management-portal/src/app/app.component.html
View file @
8444669
<!--The content below is only a placeholder and can be replaced.-->
<div>
<moya-organization-list
style=
"float:top, left;"
></moya-organization-list>
<moya-organization-list
(
selected
)="
onOrganizationChange
($
event
)"
style=
"float:top, left;"
></moya-organization-list>
<h1
style=
"text-align:center; margin-left:25%; display:inline-block"
>
Welcome to {{ title }}!
</h1>
...
...
@@ -13,9 +13,5 @@
<div
style=
"width:50%; float:right"
>
<h2>
Ei omaa organisaatiota?
</h2>
<button
(
click
)="
newOrg
()"
>
Luo uusi organisaatio
</button>
<moya-new-organization></moya-new-organization>
</div>
<<<<<<
< HEAD
<
moya-organization-list
></moya-organization-list>
<moya-event-list></moya-event-list>
=======
>>>>>>> ba42812ec6cdee25062402ba6d95b939c43ed534
code/moya-management-portal/src/app/app.component.ts
View file @
8444669
...
...
@@ -8,8 +8,12 @@ import { AppService } from './shared/app.service';
})
export
class
AppComponent
{
title
=
'Moay'
;
public
currentOrganisation
=
'insomnia'
;
public
currentOrganisation
:
string
;
constructor
(
private
appService
:
AppService
)
{
console
.
log
(
this
.
appService
.
get
());
}
onOrganizationChange
(
event
)
{
this
.
currentOrganisation
=
event
;
}
}
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
View file @
8444669
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Input
,
SimpleChanges
}
from
'@angular/core'
;
import
{
EventsService
}
from
'./event-service.service'
;
import
{
OnChanges
}
from
'@angular/core/src/metadata/lifecycle_hooks'
;
@
Component
({
selector
:
'moya-event-list'
,
templateUrl
:
'./event-list.component.html'
,
styleUrls
:
[
'./event-list.component.scss'
]
})
export
class
EventListComponent
implements
OnInit
{
export
class
EventListComponent
implements
OnInit
,
OnChanges
{
@
Input
()
organisation
:
string
;
public
events
:
any
;
constructor
(
private
appService
:
EventsService
)
{
this
.
events
=
(
this
.
appService
.
get
(
this
.
organisation
));
}
onClick
()
{
...
...
@@ -19,6 +19,12 @@ export class EventListComponent implements OnInit {
}
ngOnInit
()
{
console
.
log
(
this
.
organisation
);
this
.
events
=
this
.
appService
.
get
(
this
.
organisation
);
}
ngOnChanges
(
changes
:
SimpleChanges
):
void
{
console
.
log
(
changes
);
this
.
events
=
this
.
appService
.
get
(
changes
.
organisation
.
currentValue
);
}
}
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
View file @
8444669
...
...
@@ -4,7 +4,8 @@ import { Injectable } from '@angular/core';
export
class
EventsService
{
get
(
org
:
String
)
{
if
(
org
===
'asm'
)
{
console
.
log
(
org
);
if
(
org
===
'Assemly'
)
{
return
[
{
title
:
'Assembly Winter 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Summer 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
...
...
code/moya-management-portal/src/app/organization/organization-list/organization-list.component.ts
View file @
8444669
...
...
@@ -13,7 +13,7 @@ export class OrganizationListComponent implements OnInit {
public
selectedValue
:
string
;
@
Output
()
ngModelChange
=
new
EventEmitter
();
selected
=
new
EventEmitter
();
public
organizations
=
[
{
name
:
'Assemly Organization'
},
...
...
@@ -26,6 +26,7 @@ export class OrganizationListComponent implements OnInit {
}
onChange
()
{
this
.
selected
.
emit
(
this
.
selectedValue
);
}
ngOnInit
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment