Giter VIP home page Giter VIP logo

Comments (5)

arusahni avatar arusahni commented on August 25, 2024 1

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.

arusahni avatar arusahni commented on August 25, 2024 1

To wit, I created a demo to verify that this form of widget embed works. It's available on the demo page.

from ngtweet.

JonathanTaws avatar JonathanTaws commented on August 25, 2024

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.

arusahni avatar arusahni commented on August 25, 2024

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.

JonathanTaws avatar JonathanTaws commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.