54472: Post request on submit and collection create page

This commit is contained in:
Kristof De Langhe
2018-08-10 16:52:13 +02:00
parent 79a3788b3b
commit 79492441fc
12 changed files with 142 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
import { Component } from '@angular/core';
import { Community } from '../../core/shared/community.model';
import { ComColDataService } from '../../core/data/comcol-data.service';
import { NormalizedCommunity } from '../../core/cache/models/normalized-community.model';
import { CommunityDataService } from '../../core/data/community-data.service';
import { CollectionDataService } from '../../core/data/collection-data.service';
import { Collection } from '../../core/shared/collection.model';
@Component({
selector: 'ds-create-collection',
styleUrls: ['./create-collection-page.component.scss'],
templateUrl: './create-collection-page.component.html'
})
export class CreateCollectionPageComponent {
public constructor(private collectionDataService: CollectionDataService) {
}
onSubmit(data: any) {
const collection = Object.assign(new Collection(), {
name: data.name
});
this.collectionDataService.create(collection);
}
}