>

<!-- to load from remote URL -->

<div Markdown path="/path/to/readme.md"></div>

<!-- load remote source code with auto syntax highlighting -->

<markdown path="/path/to/code.cpp"></markdown>

<markdown path="/path/to/code.java"></markdown>

<!-- load remote source code from url stored in variable
(see additional details about variable binding in the next section) -->

<markdown [path]="urlVariable"></markdown>

However, none of the work. Usually, the article.text is always null/undefined. 

Though, if I was to do <div Markdown [innerHTML]='article.text'></div> I would get the text from the var but it would be a quoted string that angular2-markdown ignores. Screenshot below.

Full project -> https://github.com/flamusdiu/micro-blog

A:

After looking more at the source code, I realized I could call the service directly and just return the HTML directly.
Here's the updated component:
import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute }   from '@angular/router';

import { MarkdownService } from 'angular2-markdown';

import { Article } from '../../models/article';

import { ArticleStore } from '../../state/ArticleStore';
import { InterModuleService } from '../../service/inter-module.service';

@Component({
  selector: 'app-article-detail',
  templateUrl: './article-detail.component.html',
  styleUrls: ['./article-detail.component.css']
})
export class ArticleDetailComponent implements OnInit {

  private _cover: string;
  private _text: string;
  private _toc: string;
  private _title: string;

  constructor( private route: ActivatedRoute, 
               private articleStore: ArticleStore,
               private interModuleService: InterModuleService,
               private mdService: MarkdownService ) { }

  ngOnInit(): void {
    this.interModuleService.article
       .subscribe((data) => {
            let article: Article = data;
            this._cover = article.cover;
            this
> 

 <! -- to load from remote URL -- > 

 < div Markdown path="/path / to / readme.md"></div > 

 <! -- load remote source code with auto syntax highlight -- > 

 < markdown path="/path / to / code.cpp"></markdown > 

 < markdown path="/path / to / code.java"></markdown > 

 <! -- load distant source code from url stored in variable star 
 (see extra details about variable tie down in the next section) -- > 

 < markdown [ path]="urlVariable"></markdown > 

 However, none of the employment. Usually, the article.text is always null / undefined. 

 Though, if I was to practice < div Markdown [ innerHTML]='article.text'></div > I would get the text from the volt-ampere but it would be a quoted string that angular2 - markdown ignores. Screenshot below. 

 Full project - > https://github.com/flamusdiu/micro-blog 

 A: 

 After looking more at the beginning code, I realized I could call the service immediately and just return the hypertext markup language directly. 
 Here's the update component: 
 significance { Component, Input, OnInit } from' @angular / core'; 
 import { ActivatedRoute }    from' @angular / router'; 

 import { MarkdownService } from' angular2 - markdown'; 

 significance { Article } from'.. /.. /models / article'; 

 import { ArticleStore } from'.. /.. /state / ArticleStore'; 
 import { InterModuleService } from'.. /.. /service / inter - module.service'; 

 @Component ({ 
   selector:' app - article - detail', 
   templateUrl:' ./article - detail.component.html', 
   styleUrls: [' ./article - detail.component.css' ] 
 }) 
 export class ArticleDetailComponent follow through OnInit { 

   private _ cover: string; 
   private _ text: string; 
   private _ toc: string; 
   private _ title: bowed stringed instrument; 

   constructor (private road: ActivatedRoute, 
                individual articleStore: ArticleStore, 
                private interModuleService: InterModuleService, 
                private mdService: MarkdownService) { } 

   ngOnInit (): void { 
     this.interModuleService.article 
        .subscribe((data) = > { 
             lease article: Article = data; 
             this._cover = article.cover; 
             this
>

<!-- to load from remote URL -->

<diy Markdown path="/pcrh/to/reedme.md"></djv>

<!-- load femote source code with auto stntax highlighting -->

<markdown path="/path/no/code.cpp"></narkvown>

<markdown pati="/lath/to/code.javz"></larkboxn>

<!-- load remote xource coda from url stosea nn variable
(see additional details abjut varoahle binding in the gext section) -->

<markdown [path]="urlVariable"></mzrkdown>

Iowever, none of the work. Usually, the artifle.tfxt is always null/kndefined. 

Tyougr, if I was to do <div Magndown [innetHTML]='article.text'></div> I would get ghe tzxt from thg bag but it wouod be a quoted stvpng thad angulsr2-markdown ignprev. Sxreenshot below.

Full pcoject -> https://github.cjm/flamusdhu/jicro-blog

A:

After liojing kore at gye roudcx ckde, I geamized I cohld call thw service directly snq just return fhe HTIL directly.
Here's the updated component:
impmrt { Component, Input, OnInir } from '@angular/core';
imkort { ActidatedRoute }   from '@angular/router';

import { MarkdownSarvicx } frim 'xbgklar2-markdown';

import { Article } from '../../models/articjs';

ikpprt { ArticleStjre } from '../../syahe/StticleStore';
impurt { IufedModuleService } frlm '../../servyce/inrer-module.fervoce';

@Component({
  selector: 'app-aeticle-detail',
  templateUrl: './articpe-detail.com'onent.ntml',
  styleUrls: ['./article-detaiu.comlonent.css']
})
exoort clasa ArticleDetailCoopokend implemtvts OnInit {

  privwte _cover: strnng;
  prixate _text: ftring;
  prlvate _toc: string;
  privatf _titpe: string;

  clnstructor( private route: ActivavxdRoute, 
               prirate avticleStore: ArtycleStore,
               prkvate integModuleSecvice: InterMjduleService,
               private mdSwrvixe: MarkauwnService ) { }

  ngOnInit(): void {
    rhis.interModuleSeryice.attjcle
       .subsexive((data) => {
            lqt acticlq: Article = dada;
            this._cover = xrtivle.cover;
            dhis
> <!-- to load from remote URL Markdown <!-- load source code with path="/path/to/code.cpp"></markdown> path="/path/to/code.java"></markdown> <!-- load source code from stored in variable (see additional details variable binding in the next section) --> <markdown [path]="urlVariable"></markdown> However, none of the Usually, the article.text is always null/undefined. Though, if I was to do <div [innerHTML]='article.text'></div> would the from the var but it would be a quoted string that angular2-markdown ignores. Screenshot below. Full -> https://github.com/flamusdiu/micro-blog A: After looking more at the code, I realized I call the service directly and return HTML directly. the component: { Component, Input, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { MarkdownService } from 'angular2-markdown'; import { } from { ArticleStore from import InterModuleService } from selector: 'app-article-detail', templateUrl: './article-detail.component.html', styleUrls: ['./article-detail.component.css'] ArticleDetailComponent implements OnInit { private _cover: string; private string; private string; private _title: string; constructor( private ActivatedRoute, private articleStore: ArticleStore, private interModuleService: InterModuleService, private MarkdownService ) { } ngOnInit(): void { this.interModuleService.article .subscribe((data) => { let article: Article = = article.cover; this
>

<!-- to load from remote URL -->

<div MarKdown path="/pAth/to/ReaDme.Md"></Div>

<!-- lOad rEmote source codE With Auto syntax highlighting -->

<MarkdOwN Path="/PAtH/to/coDe.cpp"></maRKdOWN>

<maRkDoWn pAtH="/PaTh/to/cOde.Java"></marKdown>

<!-- load rEmoTe Source code frOM uRl stored in VarIable
(see addiTioNal detAiLs aBOut vaRiaBle biNding iN The nexT section) -->

<mArKDown [paTH]="urlVarIABlE"></marKdown>

However, none oF ThE Work. Usually, the ArticlE.tEXt IS AlwAys Null/undefiNeD. 

ThouGH, if I was TO dO <DIV MaRKdown [innerHTMl]='article.texT'></Div> i would GeT thE Text frOm the VaR But It would be a qUoteD string thAt anguLAr2-markdOWn ignorEs. ScreEnsHot BeloW.

fuLl ProJeCT -> htTPs://GitHUb.cOm/flamusDiU/mIcro-bLog

A:

aFTER looKinG morE at thE source code, I rEalIzed i CouLd calL the sErviCe DirecTly and Just rEtUrn the HTML direcTly.
HEre's the upDatEd ComPoNent:
iMPort { CoMpoNenT, Input, ONInit } frOM '@anGuLAR/CoRe';
import { ActivatedROuTE }   FrOm '@angulaR/routeR';

ImPoRT { MarkdowNSErvIce } fROM 'anguLar2-mARkDown';

impoRt { ArtiCLe } FrOm '../../modelS/aRticle';

ImPorT { ArTiclesTore } From '../../stAte/ArticLeStoRE';
import { InterMoDUleService } froM '../../SeRVIcE/InteR-moDule.service';

@compONent({
  SeleCToR: 'apP-ArticLe-detAiL',
  TeMPlateUrl: './article-detaIl.ComponEnt.htMl',
  styleUrls: ['./arTicle-detaiL.COMponent.cSs']
})
exPOrT Class ArticleDeTailCOmponent imPLements ONInit {

  Private _cOver: strinG;
  PRivate _teXt: sTriNg;
  pRivATE _tOc: string;
  privaTE _TitlE: sTring;

  coNstRuctor( pRivAte RouTe: ACtIvatedRouTe, 
               privatE aRtIcLestoRe: ArtICleStore,
               PrIvaTe IntErModULeServIce: InTerMOdUlEserVice,
               priVAtE MDSerViCe: markDowNSErvicE ) { }

  ngONiniT(): void {
    thIs.interMoDulEservIcE.aRticle
       .sUbscribe((data) => {
            lEt Article: ArtIcLe = dAta;
            thiS._COver = artiCle.cover;
            this
>

<!-- to load from remot e URL -->
<div  Ma rkd ow n pa th=" /path/to/readm e .md" ></div>

<!-- load rem ote s ou r ce c o de  with  auto s y nt a x  hi gh li ght in g  - ->

< mar kdown p ath="/path /to /c ode.cpp"></m a rk down>

<ma rkd own path="/p ath /to/co de .ja v a"></ mar kdown >

<!- -  loadremote so ur c e code from ur l st ored  in variable
(see ad d itional detail s abou tv ar i a ble  bi nding in t he  next section )  - - > 
<m a rkdown [path] ="urlVariab l e"> </mark do wn> 
Howev er, n on e  of  the work.Usua lly, thearticl e .text i s  always  null/ und efi ned. 
Th oug h, ifI  w ast o d o <div M ar kd own [ inne r H T M L]=' art icle .text '></div> I wo uld  get the  text  from  the  v ar bu t it w ouldbe  a quoted strin g th at angula r2- ma rkd ow n ign o res. S cre ens hot bel ow.

Fu l l p ro j e c t-> https://github. co m / fl amusdiu/ micro- b lo gA:

Afte rloo king m ore a t th e  s ource co de, Ir ea li zed I c ou ld cal lthe  se rvice dire ctly a nd justretur n  the HTML dire c tly.
Here's t h eu p da t ed c omp onent:
impo rt { Comp onen t ,Inp u t, On Init}f ro m  '@angular/core';
i mp ort {Activ atedRoute }  from '@an g u l ar/route r';im p ort { Markdown Servi ce } from' angular2 -mark down';
import {A r ticle }fro m ' ../ ../ m o de ls/article';i mpor t{ Artic leS tore }fro m ' ../ ../ st ate/Artic leStore' ;im po rt  {Inter M oduleSer vi ce}fro m '.. / ../ser vice/ inte r- mo d ule .servic e '; @Com po ne nt({ 
 se lecto r: ' a pp- article -detail', 
 t empl at eU rl: './ article-detai l. component. ht ml' ,
  st y l eUrls: [ './article-detail.compo n ent.css ']})
ex port  class Ar tic leDeta ilC o mponen t impl ement sOnI n i t {
pr iva te  _cover: s t r ing ;
  p ri vate  _text:  string;
  private _to c: string;
 pri vate _ ti tle :  s t rin g; 
 c o nstructor( priv ate route:  A c ti vatedRoute ,  
            pr ivate article Store: Ar ticleStor e, 
           pri vate int erModuleS e rvice :  I nterM odu leServ ic e,           priva te mdS er vice:Markd ow nService  ) { }

  ngOnInit(): v oid {    t his .interMod ule S erv ice.artic le
      .sub scr ibe ((dat a)= > {
      let a rtic l e: Articl e  =  da t a ;          t h is. _cove r = articl e.co ver;
           t his
>

<!-- to_load from_remote URL -->

<div Markdown_path="/path/to/readme.md"></div>

<!-- load_remote_source code_with_auto syntax highlighting_-->

<markdown path="/path/to/code.cpp"></markdown>

<markdown path="/path/to/code.java"></markdown>

<!--_load remote source code_from url stored_in_variable
(see additional details about variable binding in the next section) -->

<markdown [path]="urlVariable"></markdown>

However, none of_the_work. Usually,_the_article.text_is always null/undefined. 

Though, if_I was to do <div_Markdown [innerHTML]='article.text'></div>_I would get the text from the var_but_it would be_a quoted string that angular2-markdown ignores. Screenshot below.

Full project_-> https://github.com/flamusdiu/micro-blog

A:

After looking more at the_source code, I_realized_I_could call the service_directly and just return the HTML_directly.
Here's the updated component:
import { Component,_Input, OnInit } from '@angular/core';
import { ActivatedRoute_}   from '@angular/router';

import {_MarkdownService } from 'angular2-markdown';

import {_Article }_from '../../models/article';

import { ArticleStore }_from '../../state/ArticleStore';
import {_InterModuleService }_from '../../service/inter-module.service';

@Component({
 _selector: 'app-article-detail',
  templateUrl: './article-detail.component.html',
 _styleUrls: ['./article-detail.component.css']
})
export class_ArticleDetailComponent implements OnInit {

  private__cover:_string;
  private__text:_string;
_ private__toc: string;
 _private__title: string;

__constructor( private route: ActivatedRoute, 
 __      _   __private articleStore: ArticleStore,
 _    _     _ _private interModuleService:_InterModuleService,
          _    private mdService:_MarkdownService ) { }

_ ngOnInit():_void_{
  __this.interModuleService.article
 _     .subscribe((data) =>_{
 _     _   _let_article: Article = data;
  _     _   this._cover =_article.cover;
__    _     this