# ngx-markdown-parser

> This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.9.

Latest version **1.2.3** (published 2021-01-28) · 0 weekly downloads

## Install

```sh
npm install ngx-markdown-parser
pnpm add ngx-markdown-parser
yarn add ngx-markdown-parser
bun add ngx-markdown-parser
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2021-01-28 |
| First published | 2021-01-27 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 30.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bboyjure |

## Links

- npm: https://www.npmjs.com/package/ngx-markdown-parser
- npm.io page: https://npm.io/package/ngx-markdown-parser

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0

## Recent versions

- 1.2.3 (latest) — 2021-01-28
- 1.2.1 — 2021-01-28
- 1.2.0 — 2021-01-28
- 1.0.0 — 2021-01-27
- 0.0.3 — 2021-01-27
- 0.0.2 — 2021-01-27
- 0.0.1 — 2021-01-27

## README

# NgxMarkdownParser

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.9.

## Start

Run this command to install all the nessesery tools.

```shell
npm i ngx-markdown-parser marked 
```


## How to use

### component.ts

Now that npm install is done we can start uisng this package. In component.ts import NgxMarkdownParserService. We need to subscribe to markdownSubject to recive data/response and also call getMarkdownFile and pass path to the file.md that we want to display

```shell
export class AppComponent implements OnInit {
  markdown: string;
  constructor(private markdownParserService: NgxMarkdownParserService){
  }

  ngOnInit(): void{
    this.markdownParserService.getMarkdownFile(path-to-file.md).subscribe({
      next: response => this.markdown = response,
	  error: err => console.error(err)
    });
  }
}
```

### module.ts
In module.ts we need to import HttpClientModule and import it via imports declaration.

```shell
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    HttpClientModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

### html

Now we can simply use our markdown varibale from component.ts inside html tags
```shell
<div [innerHTML]='markdown'></div>
```

### We are done


## Publishing

After building your library with `ng build NgxMarkdownParser`, go to the dist folder `cd dist/ngx-markdown-parser` and run `npm publish`.

## Running unit tests

Run `ng test NgxMarkdownParser` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

---
_Source: https://npm.io/package/ngx-markdown-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
