Skip to content

Instantly share code, notes, and snippets.

View kkurni's full-sized avatar

Kurniawan Kurniawan kkurni

  • Microsoft
  • Redmond
View GitHub Profile
@kkurni
kkurni / kk-angular-resource-1.1.2
Last active December 11, 2015 21:28
AngularJS Resouce (1.1.2) with custom header params. Example to use. Authenticate.signIn(null,null, function (data, headers) { console.log(headers('x-token')); }, function(data, status, headers, config) { console.log('fail'); }, { 'Authorization': 'Basic dGVzdGtrMTNAdGVzdC5jb206cGFzc3dvcmQhMQ==' } );
'use strict';
/**
* @ngdoc overview
* @name ngResource
* @description
*/
/**
* @ngdoc object
@kkurni
kkurni / kk-example-angularjs-cors
Last active September 25, 2018 18:13
CORS Demo with Angular JS
var AngularJSApp = angular.module("AngularJSApp", ["ngResource", "ngSanitize"])
.config(function ($routeProvider, $httpProvider) {
$routeProvider.
when('/', { controller: NavigationCtrl, templateUrl: 'navigation.html' }).
when('/feedback', { controller: FeedbackCtrl, templateUrl: 'feedback.html' }).
otherwise({ redirectTo: '/' });
$httpProvider.defaults.withCredentials = true;
delete $httpProvider.defaults.headers.common["X-Requested-With"];