This file contains hidden or 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
function promise() { | |
var xhr = $http(optsObj); | |
return xhr; | |
} | |
var xhr = promise() | |
xhr.sucess(function(err, resp) {}); |
This file contains hidden or 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
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"; | |
$http.defaults.transformRequest.unshift(function (data, headersGetter) { | |
var key, result = []; | |
for (key in data) { | |
if (data.hasOwnProperty(key)) { | |
result.push(encodeURIComponent(key) + "=" + encodeURIComponent(data[key])); | |
} | |
} | |
return result.join("&"); | |
}); |
This file contains hidden or 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
var app = app || {}; | |
/** | |
* angular xhr modal directive | |
* @param | |
*/ | |
app.directive('xhrModal', ['$http','$compile', | |
function ($http, $compile) { | |
function compile (elem, cAtts) { |
This file contains hidden or 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
var app = app || {}; | |
app.filter('prettyPhone', function () { | |
return function (input) { | |
input = input || null; | |
if (input) { | |
if ((input[0] == '(') || (!~input.indexOf('-'))) { | |
return input; | |
} else { |
This file contains hidden or 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
var extend = function (dest) { | |
var args = Array.prototype.slice.call(arguments, 1), | |
ln = args.length; | |
for (var i=0;i<ln;++i) { | |
for (var o in args[i]) { | |
dest[o] = args[i][o]; | |
} | |
}; | |
return dest; | |
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
console.log(meow); // undefined | |
var meow = 'meow'; | |
console.log(meow); // 'meow' | |
console.log(bark); //ReferenceError: bark is not defined |
This file contains hidden or 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
(function(root, doc) { | |
/** | |
* dom.ready.js is a tiny library | |
* to help with cross-browser compatible | |
* `DOMContentLoaded` (dom ready) | |
* event binding | |
* | |
* author: dhigginbotham | |
* license: MIT |
This file contains hidden or 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
(function (root) { | |
/** | |
* data events add event listeners | |
* on data-attributes, ie8+ | |
* | |
* author: dhigginbotham | |
* license: MIT | |
*/ |