angular-svg-base

WebJar for angular-svg-base

License

License

Apache 2
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-svg-base
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

angular-svg-base
WebJar for angular-svg-base
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jeffbcross/angular-svg-base

Download angular-svg-base

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-svg-base/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-svg-base</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-svg-base/
implementation 'org.webjars.bower:angular-svg-base:0.0.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-svg-base/
implementation ("org.webjars.bower:angular-svg-base:0.0.1")
'org.webjars.bower:angular-svg-base:jar:0.0.1'
<dependency org="org.webjars.bower" name="angular-svg-base" rev="0.0.1">
  <artifact name="angular-svg-base" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-svg-base', version='0.0.1')
)
libraryDependencies += "org.webjars.bower" % "angular-svg-base" % "0.0.1"
[org.webjars.bower/angular-svg-base "0.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

angular-svg-base

Note: If you open an issue or PR here, please tweet me at jeffbcross so I will notice it.

This is a set of auto directives to fix SVG attributes that reference fragments within the same document via FuncIRI notation (mask="url(#someFragment)") where a base tag is present. Blink and gecko incorrectly apply these references to the base href.

The attributes that will be automatically rewritten include:

  • clip-path
  • color-profile
  • src
  • cursor
  • fill
  • filter
  • marker
  • marker-start
  • marker-mid
  • marker-end
  • mask
  • stroke

The attributes will only be rewritten if the value matches FuncIRI notation (i.e. mask="url(#aMask)") and the url contains a hash.

See AngularJS issue #8934.

Installation

$ bower install angular-svg-base

Usage

Just add the module as a dependency and it rewrites all #fragment urls to be absolute urls relative to the current document, regardless of base.

(Note: directives only apply in html5 mode, as everything works as expected otherwise).

angular.module('myApp', ['ngSVGAttributes']).
  config(function($locationProvider) {
    $locationProvider.html5Mode(true);
  });

Testing

Unit Tests:

$ npm install .
$ ./node_modules/.bin/karma start

E2E (from project root directory):

Installs npm and webdriver dependencies, then starts server and runs e2e tests.

$ ./e2etest.sh

Versions

Version
0.0.1