运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往空间
<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> <body ng-app=""> <div ng-init="myVar = 'pic_angular.jpg'"> <h1>Angular</h1> <img ng-src="{{myVar}}"> </div> <p>This example could use the original src attribute, but with AngularJS code inside the value, it is better to use the ng-src attribute instead.</p> </body> </html>