Commit d619f3cd by Emil Holsti

merge

2 parents bb81b005 4a78b325
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"@angular/common": "^5.2.0", "@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0", "@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0", "@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0", "@angular/forms": "^5.2.9",
"@angular/http": "^5.2.0", "@angular/http": "^5.2.0",
"@angular/material": "^5.2.4", "@angular/material": "^5.2.4",
"@angular/platform-browser": "^5.2.0", "@angular/platform-browser": "^5.2.0",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</h1> </h1>
<a style="float:right; font-size:20px; margin-top: 20px" href="#">Moya Login</a> <a style="float:right; font-size:20px; margin-top: 20px" href="#">Moya Login</a>
</div> </div>
<<<<<<< HEAD
<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 [organisation]="currentOrganisation" style="margin-top:5em;"></moya-event-list>
...@@ -13,4 +14,8 @@ ...@@ -13,4 +14,8 @@
<div style="width:50%; float:right"> <div style="width:50%; float:right">
<h2>Ei omaa organisaatiota?</h2> <h2>Ei omaa organisaatiota?</h2>
<button (click)="newOrg()">Luo uusi organisaatio</button> <button (click)="newOrg()">Luo uusi organisaatio</button>
</div> </div>
\ No newline at end of file =======
<moya-event-list></moya-event-list>
<moya-new-organization></moya-new-organization>
>>>>>>> 4a78b3257e1ab2f6f8dbc3b774802a9865ca5d4f
<p> <form [formGroup]="organizationForm" (ngSubmit)="onSubmit()">
new-organization works! <mat-form-field>
</p> <input matInput required placeholder="Organization name" formControlName="name">
</mat-form-field>
<mat-divider [vertical]="true"></mat-divider>
<mat-form-field>
<input matInput placeholder="Address" formControlName="address">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Postal code" formControlName="postcode">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="City" formControlName="city">
</mat-form-field>
<mat-divider [vertical]="true"></mat-divider>
<mat-form-field>
<input matInput placeholder="Business ID" formControlName="businessId">
</mat-form-field>
<mat-divider [vertical]="true"></mat-divider>
<mat-form-field>
<input matInput placeholder="Bank name" formControlName="bankName">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="IBAN" formControlName="iban">
</mat-form-field>
<mat-divider [vertical]="true"></mat-divider>
<button mat-button type="submit">Submit</button>
</form>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {FormControl, FormGroup} from '@angular/forms';
@Component({ @Component({
selector: 'moya-new-organization', selector: 'moya-new-organization',
...@@ -7,9 +9,30 @@ import { Component, OnInit } from '@angular/core'; ...@@ -7,9 +9,30 @@ import { Component, OnInit } from '@angular/core';
}) })
export class NewOrganizationComponent implements OnInit { export class NewOrganizationComponent implements OnInit {
public organizationForm = new FormGroup({
name: new FormControl(),
address: new FormControl(),
postcode: new FormControl(),
city: new FormControl(),
businessId: new FormControl(),
bankName: new FormControl(),
iban: new FormControl()
});
constructor() { } constructor() { }
ngOnInit() { ngOnInit() {
} }
onSubmit() {
const values = {
'name': this.organizationForm.get('name').value,
'address': this.organizationForm.get('address').value,
'postcode': this.organizationForm.get('postcode').value,
'city': this.organizationForm.get('city').value,
'businessId': this.organizationForm.get('city').value,
'bankName': this.organizationForm.get('bankName').value,
'iban': this.organizationForm.get('iban').value
};
}
} }
...@@ -6,15 +6,24 @@ import { EventListComponent } from './event-list/event-list.component'; ...@@ -6,15 +6,24 @@ import { EventListComponent } from './event-list/event-list.component';
import {MatSelectModule} from '@angular/material/select'; import {MatSelectModule} from '@angular/material/select';
import {OrganizationListService} from './organization-list/organization-list.service'; import {OrganizationListService} from './organization-list/organization-list.service';
import {MatCardModule} from '@angular/material/card'; import {MatCardModule} from '@angular/material/card';
<<<<<<< HEAD
import {MatButtonModule} from '@angular/material'; import {MatButtonModule} from '@angular/material';
import { EventsService } from './event-list/event-service.service'; import { EventsService } from './event-list/event-service.service';
=======
import { ReactiveFormsModule } from '@angular/forms';
import { MatInputModule } from '@angular/material/input';
import {MatButtonModule, MatDividerModule} from '@angular/material';
>>>>>>> 4a78b3257e1ab2f6f8dbc3b774802a9865ca5d4f
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
MatSelectModule, MatSelectModule,
MatCardModule, MatCardModule,
MatButtonModule ReactiveFormsModule,
MatInputModule,
MatButtonModule,
MatDividerModule
], ],
providers: [OrganizationListService, EventsService], providers: [OrganizationListService, EventsService],
declarations: [NewOrganizationComponent, OrganizationListComponent, EventListComponent], declarations: [NewOrganizationComponent, OrganizationListComponent, EventListComponent],
......
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
@import "~@angular/material/prebuilt-themes/indigo-pink.css"; @import "~@angular/material/prebuilt-themes/indigo-pink.css";
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!