Closed mrunwal closed 9 years ago
Can you provide us with a plunker that fails like this?
here is http://plnkr.co/edit/9IahkgyAE1ru5bJyV1wP type anything on textbox if its image url then it has update media attribute for pinterest or twitter status message.
Reason for showing this as when data coming from ajax and then we try bind with media attribute or description things doesn't looks working.
let me know if you have some solution for it.
@mrunwal Thanks for the example - try v0.0.12 !
I have tried same code but it looks its still the same.
Updated code works in plunkr for "http://lorempixel.com/1200/630/" http://plnkr.co/edit/NlnvU8D2VeY40wB846p4
I'm guessing that you don't want to have the user click on the share button before your media url has been retrieved from ajax. The share buttons will update the url when clicked. We want to keep the directives clean and light-weight without unnecessary watches.
Perhaps you can consider hiding the share buttons until you are ready to share - we have done this on a project without issue.
Thank for efforts but my logic was different. eg. when angular load the products using ajax then product attribute variables updates after few mili-seconds and then once its loaded that product variable's image should be used for pinterest. but right now when Ajax gots response and when its time to see the url...media fields is gets blank...
Anyway...thanks for help
When clicking on the pinterest icon on your page the media image is working. The url on the link has a blank media string because of the variable being blank at the linking time of the directive. The correct url is opened in the window.
If you can provide a use-case for the href live binding and a pull request we'd be happy to merge if the code stays clean.
Closing this issue for now.
Thanks it work as per your words... live binding now working. though status url does not show but when popup appears its functional.
Seems like this would be more effective if you got the URL when you do the click, instead of filling the href when the directive loads.
I am using this on a page template where the route changes and the share template is static in the sidebar and just keeps whatever the first URL was when the page loaded.
Thanks for building this! Great clean code. I, too am looking to live bind my custom URL.
I second @lommaj and his views on the subject. I am working on a playlist application, and want to be able to share each song when the url changes. Right now it is just stuck on the song that first loads.
I am trying to use functtion like
but its not converting whats present in variable.