Commit b6bb15bc by Emil Holsti

cleaning

1 parent 0b0a1953
<mat-card *ngFor="let event of events" style="margin:1em;max-width:75%"> <mat-card *ngFor="let event of events" style="margin:1em;max-width:75%">
<mat-card-title>{{event.title}}</mat-card-title> <mat-card-title>{{event.title}}</mat-card-title>
<mat-card-subtitle>{{event.date}}</mat-card-subtitle> <mat-card-subtitle>{{event.date}}</mat-card-subtitle>
<!--<mat-card-actions> <mat-card-actions>
<button mat-raised-button color="primary" (click)="onClick()" style="float:right;margin-top: ;margin-right:1em;">Edit</button> <button mat-raised-button color="primary" (click)="onClick()" style="margin-left:0.8em;">Go to event</button>
</mat-card-actions>--> </mat-card-actions>
</mat-card> </mat-card>
\ No newline at end of file
...@@ -8,7 +8,7 @@ import { OnChanges } from '@angular/core/src/metadata/lifecycle_hooks'; ...@@ -8,7 +8,7 @@ import { OnChanges } from '@angular/core/src/metadata/lifecycle_hooks';
styleUrls: ['./event-list.component.scss'] styleUrls: ['./event-list.component.scss']
}) })
export class EventListComponent implements OnInit, OnChanges { export class EventListComponent implements OnInit, OnChanges {
@Input() organisation: string; @Input() organization: string;
public events: any; public events: any;
constructor(private appService: EventsService) { constructor(private appService: EventsService) {
...@@ -19,12 +19,12 @@ export class EventListComponent implements OnInit, OnChanges { ...@@ -19,12 +19,12 @@ export class EventListComponent implements OnInit, OnChanges {
} }
ngOnInit() { ngOnInit() {
console.log(this.organisation); console.log(this.organization);
this.events = this.appService.get(this.organisation); this.events = this.appService.get(this.organization);
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
console.log(changes); console.log(changes);
this.events = this.appService.get(changes.organisation.currentValue); this.events = this.appService.get(changes.organization.currentValue);
} }
} }
...@@ -2,6 +2,4 @@ ...@@ -2,6 +2,4 @@
<mat-select placeholder="Organization" [(ngModel)]="selectedValue" (ngModelChange)="onChange($event)"> <mat-select placeholder="Organization" [(ngModel)]="selectedValue" (ngModelChange)="onChange($event)">
<mat-option *ngFor="let organization of organizations" value={{organization.name}}>{{organization.name}}</mat-option> <mat-option *ngFor="let organization of organizations" value={{organization.name}}>{{organization.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
\ No newline at end of file
{{selectedValue}}
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div style="width:50%; float:left"> <div style="width:50%; float:left">
<h2 style="margin-left: 10px">Tulevat tapahtumat</h2> <h2 style="margin-left: 10px">Tulevat tapahtumat</h2>
<moya-event-list [organisation]="currentOrganisation" style="margin-top:5em;"></moya-event-list> <moya-event-list [organization]="currentOrganization" style="margin-top:5em;"></moya-event-list>
</div> </div>
<div style="width:50%; float:right"> <div style="width:50%; float:right">
<h2>Ei omaa organisaatiota?</h2> <h2>Ei omaa organisaatiota?</h2>
......
...@@ -9,7 +9,7 @@ import { EventListComponent} from './event-list/event-list.component'; ...@@ -9,7 +9,7 @@ import { EventListComponent} from './event-list/event-list.component';
export class OrganizationComponent implements OnInit { export class OrganizationComponent implements OnInit {
title = 'Moay'; title = 'Moay';
public currentOrganisation: string; public currentOrganization: string;
constructor() { } constructor() { }
...@@ -17,7 +17,7 @@ export class OrganizationComponent implements OnInit { ...@@ -17,7 +17,7 @@ export class OrganizationComponent implements OnInit {
} }
onOrganizationChange(event) { onOrganizationChange(event) {
this.currentOrganisation = event; this.currentOrganization = event;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!