Skip to content

Instantly share code, notes, and snippets.

@buildmotion
Created February 1, 2018 07:00
Show Gist options
  • Save buildmotion/b5c8a834acbd18f766925b9e2829b8d7 to your computer and use it in GitHub Desktop.
Save buildmotion/b5c8a834acbd18f766925b9e2829b8d7 to your computer and use it in GitHub Desktop.
App.PostComponent.ts
import { Component, OnInit } from '@angular/core';
import { ComponentBase } from 'buildmotion-core';
import { Router } from '@angular/router';
import { LoggingService, Severity } from 'buildmotion-logging';
@Component({
selector: 'app-post',
templateUrl: './post.component.html',
styleUrls: ['./post.component.css']
})
export class PostComponent extends ComponentBase implements OnInit {
postContent: string;
constructor(
router: Router,
loggingService: LoggingService,
public formBuilder: FormBuilder,
) {
super('PostComponent', loggingService, router);
}
ngOnInit() {
// simulate retrieval of content from data store;
this.postContent = `hello editor from post component`;
}
onMarkdownChange(markdown: string) {
this.postContent = markdown;
console.log(`markdown: ${this.postContent}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment