Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 角度:无法将变量值分配给href_Angularjs_Facebook - Fatal编程技术网

Angularjs 角度:无法将变量值分配给href

Angularjs 角度:无法将变量值分配给href,angularjs,facebook,Angularjs,Facebook,我试图在一个有角度的网站上创建一个facebook共享按钮,但无法动态设置href属性 假设value=“abc”,问题归结如下 {{value}} 我认为原因在于价值动态地接受它的价值 如何将该值输入href属性?如果您尝试使用href=”https://www.facebook.com/sharer.php?title={{response.correct}}&u=http://example.com“?事实上,我认为href属性不是问题所在,因为我试过使用ng attr href和ng

我试图在一个有角度的网站上创建一个facebook共享按钮,但无法动态设置href属性

假设value=“abc”,问题归结如下


{{value}}
我认为原因在于价值动态地接受它的价值


如何将该值输入href属性?

如果您尝试使用
href=”https://www.facebook.com/sharer.php?title={{response.correct}}&u=http://example.com“
?事实上,我认为
href
属性不是问题所在,因为我试过使用
ng attr href
ng href
这两种工具,你可以同时使用
{{…}
如果你尝试使用
href=”https://www.facebook.com/sharer.php?title={{response.correct}}&u=http://example.com“
?事实上,我认为
href
属性不是问题所在,因为我试过使用
ng attr href
ng href
,并且您可以使用
{{…}
<!-- language: lang-html -->    
    {{value}} <!-- ""-->  
    <span ng-bind="value"></span> <!-- "abc" -->      

    <a href="http://example.com/{{value}}">link1</a> <!-- href="http://example.com" -->
    <a ng-href="http://example.com/{{value}}">link2</a> <!-- href="http://example.com" -->
    <a ng-attr-href="http://example.com/{{value}}">link3</a> <!-- href="" -->