Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-highlight-js

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-highlight-js

Angular for syntax highlighting with highlight.js

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
decreased by-6.01%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-highlight-js

Angular for syntax highlighting with highlight.js

NPM version Build Status

Demo

Installation instructions

1、Install

npm install --save ngx-highlight-js

Import the HighlightJsModule in to your root AppModule.

import { HighlightJsModule } from 'ngx-highlight-js';
@NgModule({
  imports: [ HighlightJsModule ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

2、Add highlight.js

Load the highlight.js and theme css in page.

<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/atom-one-dark.min.css">

Only <textarea> Tag

<textarea highlight-js [options]="{}" [lang]="'typescript'">
/* tslint:disable */
import { Component } from '@angular/core';

@Component({
    selector: 'demo',
    templateUrl: './demo.component.html',
    styleUrls: ['./demo.component.scss']
})
export class DemoComponent {
    switchStatus: boolean = true;
}
</textarea>

[options] equar configure(options). (optional)

[lang] uses language detection by default but you can specify the language. (optional)

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)

Keywords

FAQs

Package last updated on 28 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc