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

angular-render-html-once

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-render-html-once

Anuglar helper component for HTML string that should be rendered once and maintaned later

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
increased by1300%
Maintainers
1
Weekly downloads
 
Created
Source

angular-render-html-once

This library helps to keep HTML string rendered once, even if they originally were rendered server-side.

Whenever rendering would occur, and HTML string has already been rendered, resulting DOM elements will be re-used.

This is quite important when integrating angular app with external code maintained by some other library.

Usage

bootstrap (optional)

Call no-argument static method RenderHtmlOnceComponent.registerServerSideRenderedComponents() wherever applicable (eg. in your application module's constructor) to have it scan for any server-side rendered components that could be already used.

Important: this needs to be done before any angular rendering occurs, since first thing angular does is clearing any existing content of root DOM element.

Component
  • use <angular-render-html-once> component wherever you would normally use [innerHtml] directive
  • inputs:
    • id required - plain old HTML id attribute; required to match components whenever they could be destroyed and created again (or created from scratch browser-side and match them with their server-side rendered counterparts)
    • htmlContent required - HTML content string you wish to have embedded within component

Requirements

  • angular ^8.0.0

FAQs

Package last updated on 12 Aug 2020

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