question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to amp-bind [href] on <a> tag

See original GitHub issue

Hi @choumx , I am facing another issue again with amp-bind, we do have requirement to dynamically set the [href] on <a> tag. By default behavior, [href] does prepend ‘https://domain.name’ BUT amp.bind does not recognize ‘:’ colon symbol. I personally dont see any chance that [href] will work in any case because of the conflicting of preprend colon symbol from [href] while amp.bind is not recognizing colon symbol. I tried to google around and couldn’t find any example with the use of [href], while there is a guy on [stackoverflow] (https://stackoverflow.com/questions/46286976/how-can-i-perform-string-manipulations-inside-an-amp-list-template) is facing the same issue as I am. Please advise how can I achieve amp-bind with [href], appreciate your help on this , much thanks.

dingtalk20171227210317 dingtalk20171227210531

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
leonaliciouscommented, Dec 28, 2017

We found the root cause, the [href] will be prepended with https://domain only if the <a [href]> is located inside <amp-list>, hope it helps

1reaction
dreamofabearcommented, Jan 9, 2018

@leonalicious Verified this is fixed on version 1515455265699.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why data-amp-bind-href or [href] don't work in ... - Stack Overflow
I want to create a dynamic link in amp. Everything is OK when use amp-bind component except bind state to href! My code...
Read more >
Documentation: <amp-bind> - amp.dev
Bindings : Special attributes that link an element's property to a state via an expression. A property is bound by wrapping it inside...
Read more >
Google AMP - Data Binding - Tutorialspoint
Amp -bind helps to add interactivity to the amp-components and html tags based on a action using data-binding and JS-like expressions.
Read more >
How to change/update CSS class dynamically using amp-bind ...
Sometimes you want to add custom interactivity to your AMP pages to make ... Binding: They are a special attribute that is used...
Read more >
Amp-bind: Features, Application, and Examples - Mailmodo
How to Use amp-bind to Create Interactive AMP Emails ... The recent popularity of Wordle has taken the internet by storm. And if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found