Input:
var someDynamicParam = 9812894732432;
$location.search('myParams', someDynamicParam).path('/request');Output:
| OrderDate | |
| Region | |
| Rep | |
| Item | |
| Units |
| /** | |
| * Read the post for full details, hope these comments are helpful! | |
| * http://toddmotto.com/angular-js-dependency-injection-annotation-process | |
| */ | |
| function annotate(fn, strictDi, name) { | |
| var $inject, | |
| fnText, | |
| argDecl, | |
| last; | |
| function annotate(fn, strictDi, name) { | |
| var $inject, | |
| fnText, | |
| argDecl, | |
| last; | |
| if (typeof fn === 'function') { | |
| if (!($inject = fn.$inject)) { | |
| $inject = []; | |
| if (fn.length) { |
| function extend (target, source) { | |
| var a = Object.create(target); | |
| Object.keys(source).map(function (prop) { | |
| prop in a && (a[prop] = source[prop]); | |
| }); | |
| return a; | |
| }; |
| function extend (target, source) { | |
| target = JSON.parse(JSON.stringify(target)); | |
| Object.keys(source).map(function (prop) { | |
| Object.prototype.hasOwnProperty.call(target, prop) && (target[prop] = source[prop]); | |
| }); | |
| return target; | |
| }; |
| /*! | |
| * $rootScope listeners, remember to unbind on $destroy | |
| */ | |
| var $rootListeners = { | |
| 'transmitProgress': $rootScope.$on('transmit:progress', transmitProgress), | |
| 'transmitSuccess': $rootScope.$on('transmit:success', transmitSuccess), | |
| 'transmitError': $rootScope.$on('transmit:error', transmitError) | |
| }; | |
| // iterate the Object and pass the methods to be called on $destroy |
| /** | |
| * @name xhr | |
| * @desc Dynamic $http/$q | |
| * @param {String} [type] HTTP method | |
| * @param {Array} config Array of config to be called with .apply() | |
| * @private | |
| * @returns {Object} deferred.promise | |
| */ | |
| var xhr = function (type, config) { | |
| if (!config && angular.isArray(type)) { |
| var query = function (endpoint) { | |
| var deferred = $q.defer(); | |
| $http.get(endpoint) | |
| .success(function (data) { | |
| deferred.resolve(data); | |
| }) | |
| .error(function (data) { | |
| deferred.reject(data); | |
| }); | |
| return deferred.promise; |
Input:
var someDynamicParam = 9812894732432;
$location.search('myParams', someDynamicParam).path('/request');Output:
| var input = document.querySelector('input[type=password]'); | |
| var britishGasPasteHandler = function () { | |
| if (window.certificate) { | |
| certificate.revoke(); | |
| } | |
| }; | |
| input.addEventListener('paste', britishGasPasteHandler, false); |