ng-highlight

1.0.0 • Public • Published

HighlightJS Directive For Angular2+

Install

    npm install ng-highlight

Usage

Add any theme (css) from highlight.js to your index.html file.

E.g.

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">

Then:

app.module.ts

    ...
    import { HighlightDirective } from 'ng-highlight'

    @NgModule({
         declarations: [
             ...,
             HighlightDirective
         ],
         ...
    })
    export class AppModule { }

app.component.html

    <pre><code appHighlight class="lang-...">{{...}}</code></pre>

Package Sidebar

Install

npm i ng-highlight

Weekly Downloads

17

Version

1.0.0

License

ISC

Last publish

Collaborators

  • bunyaminsg