In angular I set awesomeThing.name to base64 data
And I want to read it into .
I tried:
'use strict'
angular.module 'papaApp'
.config [
"$compileProvider"
($compileProvider) ->
$compileProvider.aHrefSanitizationWhitelist /^\s*(https?|ftp|mailto|data):/
]
.controller 'MainCtrl', ['$scope', '$http', 'socket', '$sce', ($scope, $http, socket, $sce) ->
$scope.awesomeThings = []
$http.get('/api/things').success (awesomeThings) ->
$scope.awesomeThings = awesomeThings
socket.syncUpdates 'thing', $scope.awesomeThings
for awesomeThing in $scope.awesomeThings
$sce.trustAsResourceUrl awesomeThing.name
$scope.addThing = ->
return if $scope.newThing is ''
$http.post '/api/things',
name: $scope.newThing
$scope.newThing = ''
$scope.deleteThing = (thing) ->
$http.delete '/api/things/' + thing._id
$scope.$on '$destroy', ->
socket.unsyncUpdates 'thing'
]
but still get error:
Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: data:audio/mp3;base64,//sQxAADwAABpAAAACAAADSAAAAE8cGnkAH+AOE/hcIGJPyWA8gso…VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==
how should I use $sce.trustAsResourceUrl for array?