import { Component , Input , OnInit } from "@angular/core" ; import { ActivatedRoute } from "@angular/router" ; import { MarkdownPageConfig } from "../MarkdownPageConfig" ; import { RouteData } from "../../view/dynamic-routing/view-config.interface" ; /**
 * Display markdown formatted page that is dynamically loaded based on the file defined in config.
 */ @ Component ( { selector : "app-markdown-page" , templateUrl : "./markdown-page.component.html" , styleUrls : [ "./markdown-page.component.scss" ] , } ) export class MarkdownPageComponent implements OnInit { /** filepath to be loaded as markdown */ @ Input ( ) markdownFile : string ; constructor ( private route ) { } ngOnInit ( ) { this . route . data . subscribe ( ( data ) => ( this . markdownFile = data . config . markdownFile ) ) ; } }