diff --git a/src/app/creator-text-content/creator-text-content.component.ts b/src/app/creator-text-content/creator-text-content.component.ts index 0e65839c428ef64df950b27e5e33c319115ae5e9..8d14247a00cc6f6aae953ceebb76513b1db2e6fd 100644 --- a/src/app/creator-text-content/creator-text-content.component.ts +++ b/src/app/creator-text-content/creator-text-content.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { TextContent } from '../text-content'; +import { ContentService } from '../content.service'; @Component({ selector: 'app-creator-text-content', @@ -10,19 +11,24 @@ export class CreatorTextContentComponent implements OnInit { content: TextContent = new TextContent('1', '1', - '1', - 'Text Content 1', - 'This is the body of Text Content 1', + '0', + '', + '', 1); - constructor() { + constructor(private contentService: ContentService) { } ngOnInit() { } submitContent() { - + if (this.content.contentId === '1') { + this.contentService.addContent(this.content).subscribe(); + } else { + // ToDo: Implement function in service + // this.contentService.updateContent(this.content).subscribe(); + } } }