Skip to content
Angular 8 wrapper for very cool text highlighting lib Mark.js
TypeScript HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
e2e
projects/ngx-markjs
src
.editorconfig
.gitignore
README.md
angular.json
browserslist
karma.conf.js
ngx-markjs.gif
package-lock.json
package.json
tsconfig.app.json
tsconfig.json
tsconfig.spec.json
tslint.json

README.md

ngx-markjs

It is Angular 8 wrapper for very cool text highlighting lib Mark.js

How to use

Install

npm i ngx-markjs

Import module

...
import {NgxMarkjsModule} from 'ngx-markjs';

@NgModule({
...
  imports: [
...
    NgxMarkjsModule
  ],
...
})
export class AppModule { }

Use directive

<div class="content_wrapper" 
     [markjsHighlight]="searchText"
     [markjsConfig]="config"
     [scrollToFirstMarked]="true"
>

If you want to use it from source code

Incase of some compilation issues you can try to import ngxMarkjsModule directly in your application from .ts file

import {NgxMarkjsModule} from 'ngx-markjs/src/public-api'; 

But in that case you should include path to module in tsconfig.json ('include' section).

Start demo project

Clone this repo and do install

npm install

ng serve

demo app

Additional mark.js config params can be found on its officail site

Did you Like this lib? Follow me on Twitter for more Angular and RxJS staff!

Need a mentorship for Angular and RxJS? Find me on codementor.io

You can’t perform that action at this time.