Javascript 使用角度传感器将二值图像传递给模态

Javascript 使用角度传感器将二值图像传递给模态,javascript,angularjs,twitter-bootstrap,Javascript,Angularjs,Twitter Bootstrap,我有一些代码,在将数据从视图传递到模式时可以正常工作。然而,我现在正试图将一个二进制图像传递给一个模态,但它不起作用。图像在视图中显示为jpeg,这也是我在模式中需要的 看法 我知道这已经很老了,但是对于任何一个偶然发现这一点的人(像我一样),img标签的格式是错误的。它应该是这样的: <img src="data:image/jpg;base64,{{item.Image}}" style="height:150px; width:150px;"> $scope.curre

我有一些代码,在将数据从视图传递到模式时可以正常工作。然而,我现在正试图将一个二进制图像传递给一个模态,但它不起作用。图像在视图中显示为jpeg,这也是我在模式中需要的

看法


我知道这已经很老了,但是对于任何一个偶然发现这一点的人(像我一样),img标签的格式是错误的。它应该是这样的:

<img src="data:image/jpg;base64,{{item.Image}}" style="height:150px; width:150px;">

 $scope.currentItem = null;
$scope.getIceDesignImage = function (item) {
    $scope.currentItem = item;

    var modalInstance = $modal.open({
        templateUrl: 'myModalContent',
        controller: 'MainCtrl',
        resolve: {
            currentItem: function () {
                return $scope.currentItem;
            }
        }
    });

    modalInstance.result.then(function (selectedItem) {
        $scope.selected = selectedItem;
    }, function () {

    });
}
<img src="data:image/jpg;base64,{{item.Image}}" style="height:150px; width:150px;">