Skip to content

Commit

Permalink
Step 5.11: Add addParty method
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored and DAB0mB committed Dec 14, 2016
1 parent 683564c commit c666873
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/imports/app/parties/parties-form.component.ts
@@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';

import { Parties } from '../../../../both/collections/parties.collection';

import template from './parties-form.component.html';

@Component({
Expand All @@ -21,4 +23,12 @@ export class PartiesFormComponent implements OnInit {
location: ['', Validators.required]
});
}

addParty(): void {
if (this.addForm.valid) {
Parties.insert(this.addForm.value);

this.addForm.reset();
}
}
}

0 comments on commit c666873

Please sign in to comment.