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

angular-inline-svg

Package Overview
Dependencies
Maintainers
1
Versions
910
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-inline-svg

inline svg component for angular

  • 0.0.873
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

AngularJS inline-svg component Build Status

  • Include svg sprites one time at the top of the document.
  • Use inline svg symbol using <use>.
  • It is also possible to use angular binding, translations, directives, etc. in the svg sprite!

Requirements

  • AngularJS

Usage

bower for dependency management. Install and save to bower.json by running:

$ bower install angular-inline-svg --save

Add the module to your application:

<script src="bower_components/angular-inline-svg/dist/ngInlineSvg.min.js"></script>
var myAppModule = angular.module('MyApp', ['inline-svg']);

Create a symbol sprite (e.g. mySvgSymbols.html) that looks like:

<svg xmlns="http://www.w3.org/2000/svg">
  <g id="myCircle">
     // circle drawing
  </g>
  <g id="myRectange">
     // rectange drawing
  </g>
  <g id="myLogo">
     // logo drawing
  </g>
</svg>

Include the directive in your html:

<inline-svg-symbol sprite="mySvgSymbols.html" symbol="'#myCircle'"/>
<inline-svg-symbol sprite="mySvgSymbols.html" symbol="'#myRectange'"/>
<inline-svg-symbol sprite="mySvgSymbols.html" symbol="'#myLogo'"/>

Contribute

Prepare your environment:

  • Install Node.js and npm.
  • Install global dev dependencies: npm install -g bower gulp
  • Install local dev dependencies: npm install && bower install in repository directory

Development commands:

  • npm run build - to clean, jshint, build and test
  • npm run serve - to watch src files to jshint, build and test when changed

When issuing a pull request, please exclude changes from the "dist" folder to avoid merge conflicts.

FAQs

Package last updated on 19 Apr 2019

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