绝对URL正在扰乱ng src

  • 本文关键字:ng src URL 绝对 angularjs
  • 更新时间 :
  • 英文 :


所以,我已经使用了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文件中所述。

最新更新