Commit b6bb15bc by Emil Holsti

cleaning

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