Skip to content

Commit

Permalink
Step 4.9: Add Party type to data fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored and dotansimha committed Nov 27, 2016
1 parent b5f5878 commit a176b08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/imports/app/app.component.ts
Expand Up @@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { Parties } from '../../../both/collections/parties.collection';
import { Party } from '../../../both/models/party.model';

import template from './app.component.html';

Expand All @@ -10,7 +11,7 @@ import template from './app.component.html';
template
})
export class AppComponent {
parties: Observable<any[]>;
parties: Observable<Party[]>;

constructor() {
this.parties = Parties.find({}).zone();
Expand Down
5 changes: 3 additions & 2 deletions server/imports/fixtures/parties.ts
@@ -1,8 +1,9 @@
import { Parties } from '../../../both/collections/parties.collection';
import { Party } from '../../../both/models/party.model';

export function loadParties() {
if (Parties.find().cursor.count() === 0) {
const parties = [{
const parties: Party[] = [{
name: 'Dubstep-Free Zone',
description: 'Can we please just for an evening not listen to dubstep.',
location: 'Palo Alto'
Expand All @@ -16,6 +17,6 @@ export function loadParties() {
location: 'San Francisco'
}];

parties.forEach((party) => Parties.insert(party));
parties.forEach((party: Party) => Parties.insert(party));
}
}

0 comments on commit a176b08

Please sign in to comment.