Situation
I develop a site with Angular-CLI and will publish that on GitHub pages. the link to my project is https://heinpauwelyn.github.io.
I've installed a package named angular2-markdown to render markdown files on my HTML pages. Below you see my code:
<div class="container">
<div class="row">
<div class="col-md-8">
<h2>Internship</h2>
<!--
<markdown path="/reports/intro.md"></markdown>
</div>
<div class="col-md-4">
<app-reportslist></app-reportslist>
</div>
</div>
</div>
To test the site on localhost I use this command:
ng serve
This command gives no problem and render the markdown files good.
The problem
An error will be throw when I use command below to deploy my website on GitHub pages.
ng github-pages:deploy
This gives me next error:
ERROR in MarkdownModule
is not an NgModule
Here is my code in my app.module.ts
:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MarkdownModule } from 'angular2-markdown';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
MarkdownModule
],
bootstrap: [AppComponent],
})
export class AppModule { }
I've tried
Attempt one
I know on the guide stands that I must use MarkdownModule.forRoot()
. If I use now ng serve
, I've got this error:
ERROR in Error encountered resolving symbol values statically. Calling function MarkdownModule
, function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule
in C:/***/heinpauwelyn.github.io/src/app/app.module.ts
.
ERROR in C:/***/heinpauwelyn.github.io/src/app/app.module.ts
: Property forRoot
does not exist on type typeof MarkdownModule
.
Attempt two
If I comment the line export class AppModule()
like in the guide, I got this error:
ERROR in C:/***/heinpauwelyn.github.io/src/main.ts
: Module C:/***/heinpauwelyn.github.io/src/app/app.module.ts
has no exported member AppModule
.
ERROR in C:/***/heinpauwelyn.github.io/src/app/app.module.ts
: Declaration expected.
What is normal of course.
Question
How could I solve this problem?
Thanks in advance.
What I have tried:
See the question to see what I've done