简体   繁体   English

AngularJS ngrepeat img嵌入

[英]angularjs ngrepeat img embed

I am learning Angular since yesterday so the following may or may not make sense: 我从昨天开始学习Angular,因此以下内容可能有意义,也可能没有意义:

<div data-ng-repeat="social in socialnets">
    <a href="{{social.url}}" target="_blank">
       <img src="{{social.img}}" alt="{{social.alt}}" height="50">
       {{social.name}}
     </a>
</div>

the console is showing an error 控制台显示错误

GET http://10.0.0.27/%7B%7Bsocial.img%7D%7D 404 (Not Found)

meaning to me: 对我的意义:

<img src="{{social.img}} ...> 

does this mean that it is triggered once before angularjs loads the scope variable ???? 这是否意味着它会在angularjs加载范围变量之前触发一次?

the page still renders ok. 页面仍然呈现正常。 but.... What is the best way to remove the unneeded error? 但是....什么是去除不必要的错误的最好方法?

makes no sense to me as the above ng-repeat is loaded by a ng-include 没有意义的,我作为上述NG重复由装载NG-包括

<div ng-include="'html/socialbar.html'"></div>

在img标签中使用ng-src而不是src。

<img ng-src="{{social.img}} ...> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM