gpt4 book ai didi

angularjs - 绝对 URL 与 ng-src 混淆

转载 作者:行者123 更新时间:2023-12-04 04:49:45 27 4
gpt4 key购买 nike

所以,我已经用过 ng-src指令,但从不使用绝对图像 URL。现在,我遇到了问题。似乎 Angular 试图将 URL 评估为对我没有任何意义的表达式。

这是标签:

<img ng-src="{{message.logo_url}}" ng-show="{{message.logo_url}}">

这是错误消息:
Error: Syntax Error: Token ':' is an unexpected token at column 5 of the expression [http://m.c.lnkd.licdn.com/mpr/mpr/p/2/000/0ad/2dd/0511c49.png] starting at [://m.c.lnkd.licdn.com/mpr/mpr/p/2/000/0ad/2dd/0511c49.png].
at Error (<anonymous>)
at throwError (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:6671:11)
at parser (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:6663:5)
at http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:7281:29
at compileToFn (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:9214:16)
at Object.Scope.$watch (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:8546:19)
at http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:15580:11
at nodeLinkFn (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:4959:13)
at compositeLinkFn (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:4550:15)
at compositeLinkFn (http://localhost:8080/customer/service/gui/app/bower_components/angular/angular.js:4553:13) <img ng-src="{{message.logo_url}}" ng-show="{{message.logo_url}}"> angular.js:6349
(anonymous function) angular.js:6349
(anonymous function) angular.js:5420
nodeLinkFn angular.js:4962
compositeLinkFn angular.js:4550
compositeLinkFn angular.js:4553
compositeLinkFn angular.js:4553
publicLinkFn angular.js:4455
ngRepeatAction angular.js:15462
$watchCollectionAction angular.js:8717
Scope.$digest angular.js:8811
Scope.$apply angular.js:9012
done angular.js:10265
completeRequest angular.js:10449
xhr.onreadystatechange angular.js:10404

如果您还需要什么,请告诉我。

最佳答案

改用这个:

<img ng-src="{{message.logo_url}}" ng-show="message.logo_url">

ngShow 中所述的文档。

关于angularjs - 绝对 URL 与 ng-src 混淆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17615496/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com