Comments (6)
and what about using the double-quote to reference your variable,
[url]="url"
?
This is the proper way to pass input values from the view template.
from ngx-sharebuttons.
Hi @ericel, here is our validateURL
function, test it with your URL and tell me if there is a problem
validateUrl(url: string) {
/** If URL is specified then validate it, otherwise use window URL */
if (url) {
let r = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if (r.test(url)) {
return url;
} else {
console.warn('[ShareButtons]: Invalid URL, fallback to Window URL');
}
}
/** fallback to "Window" URL, or to "Global" in universal */
return (this.window) ? encodeURIComponent(this.window.location.href) : (<any>global).url || '';
}
from ngx-sharebuttons.
@MurhafSousli the url validates.
But If I get the url value from the component class to the view template
export someclass {
url = `https://someurl.com/${this.item.sid}/${this.item.item}/`
}
[url] = "url"
. I get the invalid url. I think it has something to do with passing the url variable from component class to view template.
from ngx-sharebuttons.
@ericel Did you notice what you just did? you are passing inline string instead of the variable
change
[url]="'url'"
to
[url]="url"
from ngx-sharebuttons.
@MurhafSousli that won't change a thing. It will still not accept a varable from the component class. I doubt why u closed it. But u are the author. Great job with the module though.
from ngx-sharebuttons.
@ericel closing an issue is not the end of the discussion. I close when I confirm it is not an issue, or in other meaning, no action will be taken regarding to it.
Just give angular docs more attention and you are welcome to open new issues
from ngx-sharebuttons.
Related Issues (20)
- How to use share buttons vertically? HOT 1
- share-buttons inputs don't work within square brackets. HOT 1
- add or replace twitter option for X HOT 5
- Unable to share image HOT 1
- Can't install; error with cdk version HOT 1
- Required Old Twitter Logo Update | 'X' HOT 2
- Updating to Angular 17 HOT 4
- share my articles in linkedin with preview image HOT 2
- ngx-sharebuttons for angular 9.1.3 HOT 1
- Add a service for sharing links
- LinkedIn button ignores description HOT 1
- Angular 17 using withConfig errors with Type 'ModuleWithProviders<ShareButtonsModule>' is not assignable to type 'readonly any[] | Type<any>' HOT 1
- Url trucated to 30 characters HOT 1
- Share on instagram HOT 3
- v14 (and v15) now requires icon dependencies HOT 7
- Issue after upgrading to latest ngx-buttons version HOT 3
- DEMO: Update the link to SSR documentation in FAQ
- The size of @fortawesome bundle is not reduced with custom icons HOT 7
- docs: mention that 14.0.0 needs at least Angular 17.1.0, not only v17 HOT 1
- Update package.json with homepage and other fields
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-sharebuttons.