Created
December 8, 2015 23:25
-
-
Save neilellis/95a3dafa4d5e2c58f6ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app="example"> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.js"></script> | |
</head> | |
<script> | |
angular.module('example', []). config( | |
function ($sceDelegateProvider) { | |
$sceDelegateProvider.resourceUrlWhitelist( [ | |
// Allow same origin resource loads. | |
"self", | |
"http://appz.vizz.buzz/**", | |
"https://appz.vizz.buzz/**" | |
] ); | |
} | |
).controller( | |
'ExampleController', function ($scope, $window, $http,$sce) { | |
$http({url:'https://appz.vizz.buzz/example/edit/form.html', method:"GET"}).then(function() { | |
console.log("GET: Yay!") | |
}).catch(function() { | |
console.log("GET: Oh dear ... ") | |
}); | |
$http({url:'https://appz.vizz.buzz/example/edit/form.html', method:"OPTIONS"}).then(function() { | |
console.log("OPTIONS: Yay!") | |
}).catch(function() { | |
console.log("OPTIONS: Oh dear ... ") | |
}); | |
$scope.form= $sce.trustAsUrl('https://appz.vizz.buzz/example/edit/form.html'); | |
} | |
); | |
</script> | |
<div ng-controller="ExampleController"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment