0

I have titter tweet URL where I need to pass an Angular JS expression for the test part of it. When I simply use a random text the twitter link opens successfully, but when I put an expression instead of the string it gives bad request error. Is it possible to use the expression in the link? If not what is the solution for this issue.

ng-href="https://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.website.uk;text={{desciption}}"
Nikhil Bharadwaj
  • 867
  • 4
  • 24
  • 42

2 Answers2

0

Your URL having wrong, because there having two www. and http. You should check the URL. and try this way

ng-href="mergeUrl('https://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.website.uk;text=',desciption)"

$scope.mergeUrl=function(url,param){
return url + param;
}

also read this discussion for more details

Community
  • 1
  • 1
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
0

The expression was taking the correct value, there was nothing wrong with the expression used in ng-href attribute, the issue was with improper encoding of the expression value which was part of the twitter URL

Nikhil Bharadwaj
  • 867
  • 4
  • 24
  • 42