🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ngx-text-highlight

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-text-highlight

## Installation Angular Text highlight Directive ====

0.1.6
latest
Source
npm
Version published
Weekly downloads
108
-28.48%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-text-highlight

Installation

Angular Text highlight Directive

Angular Directive to highlight the text.

Live Demo : https://mraghuram3.github.io/#/ngx-text-highlight

Installation

Install it with npm

$ npm install ngx-text-highlight --save

Usage

Import NgHighlightModule in the root module

import { NgHighlightModule } from 'ngx-text-highlight';

@NgModule({
  imports: [
    // ...
    NgHighlightModule,
    ...
  ]
})

In your template

<div ngxTextHighlight [content]="actualText" [searchTerm]="searchText"  [caseSensitive]="true">
</div>
  • [content]: string.

    the content in which the text needs to be highlighted.

  • [searchTerm]: string.

    The string which needs to be highlighted.

  • [caseSensitive]: boolean.

    Toggle between case sensitive and case insensitive search, default false.

    ** Include the css provided in your index.html or create a css class as shown below as per your requirement **

.ngx-text-highlight{
    background:yellow;
}

Note

To increase performance, the ngx-text-highlight is updated to a directive instead of component.

License

MIT © Raghu Ram M

Keywords

angular

FAQs

Package last updated on 22 Apr 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