Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.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
Angular 如何在非角度元素中使用[src]?_Angular_Aframe - Fatal编程技术网

Angular 如何在非角度元素中使用[src]?

Angular 如何在非角度元素中使用[src]?,angular,aframe,Angular,Aframe,我在Angular 2中使用 当我将图像链接直接放在src中时 <a-scene> <a-curvedimage src="https://upload.wikimedia.org/wikipedia/commons/b/be/Random_pyramids.jpg" position="0 2 0"></a-curvedimage> </a-scene> 它不会给我任何错误,但它也不会显示图像 我如何解决此问题或以任何绕行方式解决?谢谢 我

我在Angular 2中使用

当我将图像链接直接放在
src
中时

<a-scene>
  <a-curvedimage src="https://upload.wikimedia.org/wikipedia/commons/b/be/Random_pyramids.jpg" position="0 2 0"></a-curvedimage>
</a-scene>
它不会给我任何错误,但它也不会显示图像


我如何解决此问题或以任何绕行方式解决?谢谢

我不确定
a-curvedimage
元素在运行时具有哪些属性,但它可能没有反映
src
属性值的
src
属性。在这种情况下,最好的选择可能是绑定到
src
属性,如下所示:


请记住,在浏览器中呈现的元素可以同时具有属性和属性,并且可以区分绑定到这些属性和属性的角度。大多数情况下,属性和相应的属性名称是相同的,因此差异并不重要。尽管如此,有些元素的属性和属性名称不匹配,因此您需要精确地使用角度绑定语法。

我不确定
a-curveImage
元素在运行时具有哪些属性,但它可能没有反映
src
值的
src
属性属性在这种情况下,最好的选择可能是绑定到
src
属性,如下所示:

请记住,在浏览器中呈现的元素可以同时具有属性和属性,并且可以区分绑定到这些属性和属性的角度。大多数情况下,属性和相应的属性名称是相同的,因此差异并不重要。不过,有些元素的属性和属性名称不匹配,因此需要精确地使用角度绑定语法

  <a-scene>
    <a-curvedimage [src]="url" position="0 2 0"></a-curvedimage>
  </a-scene>
  url = 'https://upload.wikimedia.org/wikipedia/commons/b/be/Random_pyramids.jpg';