我是角度Js的新手。我正在使用ng-grid列出动态数据。我有音频,视频,图像作为数据。当只有图像作为数据时,它正确显示。如何在单元格模板中设置音频和视频标签。 目前我收到了错误。
scope.pinsview = {
data: 'userlist',
columnDefs: [
{field:'image_name',
displayName:'Pin',
cellTemplate:'<div ng-switch="row.getProperty(\'pin_type\')">'+
'<div ng-switch-when="image"><img src="/uploads/pins/images/{{row.getProperty(\'image_name\')[0]}}" /></div>' +
'<div ng-switch-when="audio"> <audio src="/uploads/pins/audio/{{row.getProperty(\'audio_file\')}}"> </div>' +
'<div ng-switch-when="video"><video src="/uploads/pins/videos/{{row.getProperty(\'video_id\')}}"></div>' +
'</div>'
},
{field: 'description', displayName: 'Pin'},
{field: 'user_id.username', displayName: 'Pinned By'},
{field: 'board_id.board_name', displayName: 'Pinned On'},
{field: 'Actions', cellTemplate:
'<a ng-click="deletePin(row.entity)" class="btn btn-mini tip deleteAdmin" confirmation-needed="Are you sure want to delete this group?" data-original-title="Delete"><img alt="" src="/assets/images/admin/icons/fugue/cross.png"></a> <a class="btn btn-mini tip pwdReset" ng-click="blockPin(row.entity)" data-original-title="Reset Password"><img alt="" src="/assets/images/admin/icons/fugue/flag-black.png"></a>'}],
enablePaging: true,
showFooter: true,
totalServerItems: 'totalServerItems',
pagingOptions: $scope.pagingOptions,
};
我在浏览器控制台中收到此错误
17angular.js:12332 Error: [$interpolate:noconcat] Error while interpolating: /uploads/pins/audio/{{row.getProperty('audio_file')}}
Strict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.
有人可以帮我解决这个问题吗?提前谢谢。