Comments (5)
Off the top of my head, try removing the single quotes around anid
- they're only necessary when hardcoding an ID. Similarly, for your second example, try:
<twitter-widget twitter-widget-id="tweet.id"></twitter-widget>
Let me know if this works. If not, I'll whip together a test so I can verify it on my end. If it does, I'll be sure to update the docs to be less ambiguous.
from ngtweet.
To wit, I created a demo to verify that this form of widget embed works. It's available on the demo page.
from ngtweet.
Hi arusahni,
The problem came from the single quotes as mentioned in your first post. Is that a specificity of Angular.js, or is it based on something else ?
It might be worth to put an example with a variable like in my case to avoid this situation in the future.
Thanks for your quick answer and the supplied demo, they were very helpful. And thanks for that incredibly clever library ;)
Should I proceed to "close" the issue ?
from ngtweet.
It's a little bit of both. The single quotes are needed because the ID needs to be a string - if it were an integer, we could lose some precision as the max value of a Tweet ID is greater than some browsers are capable of supporting. Since the value of the directive is bound from the directive scope to the outer scope, it must be an expression. Here's how the expression would evaluate in various cases.
expression | evaluates to |
---|---|
1234 |
number(1234) |
'1234' |
string("1234") |
tweetID |
variable(tweetID) |
'tweetID' |
string("tweetID") |
HTH! I'll be sure to update the docs with an example of binding to a variable instead of a hardcoded value, at which point I'll close this issue.
from ngtweet.
Wow, thanks for the detailed answer, couldn't expect a better explanation 👍 !
Okay, so the basics are due to integer precision, and then it's just a matter of how Angular.js handles expressions !
from ngtweet.
Related Issues (20)
- Tweets not rendering second time around. HOT 3
- Any way to show loading? HOT 14
- $compile:nonassign error when using twitter-widget-options
- ngtweet not shown inside ui-view router HOT 8
- Twitter has stopped supporting data_widget_id for many of their widgets HOT 4
- TypeError: Cannot read property 'ready' of undefined with new timeline and twitter-widget-initialize HOT 2
- Naming HOT 2
- textAngular and ngTweet HOT 4
- Render tweet after HTTP Get HOT 9
- Twitter Moments HOT 2
- iOs Bootstrap Issue HOT 8
- Does the directive need a 'destroy' handler? HOT 1
- tweet-limit doesn't work as option HOT 4
- Disable auto reload HOT 1
- cannot seem to load widget HOT 8
- twttr.ready isn't always firing HOT 3
- dynamically load timeline HOT 11
- Getting tweet event calllback HOT 5
- Generate ngtweet for tweets inside html HOT 1
- Rename occurrences of Angular to Angular.js
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 ngtweet.