为什么我可以在结构体“外部”使用枚举作为init函数的参数?因此,看起来枚举是全局的,并且不限于封闭的struct块。
scope.enableCamera = function () {
return navigator.getUserMedia({
audio: false,
video: true
},function (stream) {
return scope.$apply(function () {
scope.stream = stream;
scope.isLoaded = true;
// HERE IS THE PROBLEM !!!!!!!
return scope.videoStream = $sce.trustAsResourceUrl(window.URL.createObjectURL(stream));
});
},function (error) {
return scope.$apply(function () {
scope.isLoaded = true;
return scope.noCamera = true;
});
});