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

ng2-inline-svg

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-inline-svg

Angular 2 directive for inserting an SVG file inline within an element.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ng2-inline-svg

NPM

Demo

Angular 2 directive for inserting an SVG file inline within an element.

Based on md-icon, except this is meant purely for inserting SVG files within an element, without the extra things like font icons.

Installation

npm install --save ng2-inline-svg

Usage

Make sure to add HTTP_PROVIDERS to your bootstrap providers:

import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';

import { App } from './app/app.component';

bootstrap(App, [HTTP_PROVIDERS]);

Import the component and add it to the list of directives on your component:

import { Component } from '@angular/core';
import InlineSVG from 'ng2-inline-svg';

@Component({
  selector: 'demo',
  directives: [InlineSVG],
  template: `
    <div class="demo-svg" aria-label="My icon" [inline-svg]="'/img/image.svg'"></div>
  `
})
export class DemoComponent {
}

The SVG file (if found) will be inserted inside the element with the [inline-svg] directive.

Keywords

FAQs

Package last updated on 23 Jul 2016

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