tsmith18256 / ng-inline-href Goto Github PK
View Code? Open in Web Editor NEWAngular Directive that fixes links to inline SVGs in Firefox
Home Page: https://www.npmjs.com/package/ng-inline-href
License: The Unlicense
Angular Directive that fixes links to inline SVGs in Firefox
Home Page: https://www.npmjs.com/package/ng-inline-href
License: The Unlicense
Hi there,
I've got no problems with the dependencies and have ^4.0.0 for the angular core in my project. However, when I install the package (ng-inline-href), the module can't be found when importing in the module and I would assume it's because there's no ts file in the folder (only npmignore, package&tsconfig.json, readme and license). Can you maybe help me here? :)
Cheers, Georg
Hi Tyler. I'm using ng-inline-href with angular-cli and I'm getting the following error in my javascript console when running my app.
It links to the following in my build.
I'm guessing it's due to differences in build systems? I'm no wiz at javascript build systems. Angular-CLI just works and user webpack behind the scenes.
Let me know if you can help or if you want me to create an example repo.
Regards,
Brent
Hi Tyler - The user story came back to me so I started some tests.
If I generate the project with
ng new inline-href-ng4-test -ng4
and run
npm install --save ng-inline-href
and add the module to the .angular-cli.json file
"scripts": ["../node_modules/ng-inline-href/inline-href.js"],
then run
npm run start
The error shows up in the javascript console of chrome.
If I do the same as above but leave the ng4 flag out
ng new inline-href-ng2-test
I do not get the error.
Let me know if you can recreate.
Thanks - Brent
If got this error when building the project like this:
ng build --env=prod --prod --aot=true
ERROR in Unexpected value 'InlineHrefDirective in /Users/nbijl/projects/nomad-app/node_modules/ng-inline-href/inline-href.d.ts' declared by the module 'ComponentsModule in /Users/nbijl/projects/nomad-app/src/app/components/components.module.ts'. Please add a @Pipe/@Directive/@component annotation.
Our package.json dependencies:
"dependencies": {
"@angular/animations": "^4.1.3",
"@angular/common": "^4.1.3",
"@angular/compiler": "^4.1.3",
"@angular/core": "^4.1.3",
"@angular/forms": "^4.1.3",
"@angular/http": "^4.1.3",
"@angular/platform-browser": "^4.1.3",
"@angular/platform-browser-dynamic": "^4.1.3",
"@angular/router": "^4.1.3",
"angular-2-local-storage": "^1.0.1",
"angular2-jwt": "^0.2.3",
"angular2-moment": "^1.3.3",
"core-js": "^2.4.1",
"markdown-to-html-pipe": "^1.2.1",
"ng-inline-href": "^2.0.4",
"ng2-translate": "^5.0.0",
"ngx-bootstrap": "^1.6.6",
"ngx-clipboard": "^8.0.2",
"rxjs": "^5.4.0",
"web-animations-js": "^2.2.5",
"zone.js": "^0.8.11"
}
Any ideas?
Hello ๐
This code is awesome! You saved my life ๐ ๐
Except one thing,
When installing this package, npm is telling me warning.
Anyway, this package works fine with Angular v4.
Do you have any plans to update package.json to make this warning clear?
pc:awesome-project pittan$ npm install --save ng2-inline-href
[email protected] /Users/pittan/Dev/awesome-project
โโโ UNMET PEER DEPENDENCY @angular/[email protected]
โโโ [email protected]
npm WARN [email protected] requires a peer of @angular/[email protected] but none was installed.
Just making a note to myself to change the README from using systemjs to the ng-cli, since that has become the standard.
Originally reported by @LinkinGeorge in #6.
When using ng-inline-href, it is working correctly; however, when running it with the --prod
flag, it is generating href="http://localhost:4200/undefined"
.
I pre-compilled my app with the following command:
ng build --output-path=dist/files/en --aot -prod --env=prod --bh /booq-angular/en/ --i18n-file=src/locale/messages.en.xlf --i18n-format=xlf --locale=en
Also I deployed it on my Tomcat with /booq-angular path so my final url is http://localhost:7380/booq-angular/en/products.
All the SVG do not work for me even though it works on development environment.
Here is what's in html in production
<svg class="table-icon edit-icon" eijsink-color="" viewBox="0 0 24 24">
<use inlineHref="#edit" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/products#edit"></use>
</svg>
Hi,
there is a problem to install npm install ng-inline-href
with actual version of Angular 4.0.2:
+-- UNMET PEER DEPENDENCY @angular/[email protected] invalid
+-- [email protected]
`-- UNMET PEER DEPENDENCY [email protected]
As you can see there is the same problem with [email protected]
There are also some inaccuracies related to ng2-inline-href
-> ng-inline-href
.
Hi,
I am getting below errors while adding BrowserAnimationsModule in my project.
Please help here.
Uncaught Error: Unexpected module 'BrowserAnimationsModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@component annotation.
I'm using the ng-bootstrap
modal in combination with ng-inline-href
. ng-inline-href
works fine on the site, but not when you use it inside a modal. The inlineHref
attribute stays untouched.
I guess that the dynamically added modal somehow doesn't trigger ng-inline-href
as there's no error or anything.
The InlineHrefModule
has been imported in app.module.ts
. app.module.ts
also imports the modal.
In using Angular Universal i see the problem: ERROR ReferenceError: window is not defined
Maybe instead of using window
use Location service or something similar?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.