-
git stash
保存当前的工作进度。会分别对暂存区和工作区的状态进行保存
-
git stash save "message..."
这条命令实际上是第一条 git stash
命令的完整版
import Service from 'path/to/service'; | |
import 'jasmine-ajax' | |
describe('Service', () => { | |
let request, promise; | |
let instance = Service; | |
let payload = {foo:'bar'}; | |
let path = '/path'; | |
let callback = jasmine.createSpy('callback'); |
import axios from 'axios'; | |
function mixParams(url, params) { | |
let copyParams = Object.assign({}, params); | |
let urls = url.replace(/\:([^/:?&]+)/g, ($0, $1) => { | |
delete copyParams[$1]; | |
return params[$1]; | |
}); | |
urls.includes('?') ? urls = urls + '&' : urls = urls + '?'; |
//::LICENSE:://
(function(global){
//::SIGNAL_BINDING_JS:://
//::SIGNAL_JS:://
//exports to multiple environments
if(typeof define === 'function' && define.amd){ //AMD
当单独使用 transformResponse 时: 如下,当然不推荐这样做, 最好是参考官方例子,将自己的 transformResponse 作为默认 transformResponse 的数组的一个成员,自己参见官网
export const MenuResource = genResource('/menus', null, null, {
query: {
isArray: true,
method: 'GET',
transformResponse: (result) => {
const res = angular.fromJson(result);
return res;
/** | |
* Fire an event handler to the specified node. Event handlers can detect that the event was fired programatically | |
* by testing for a 'synthetic=true' property on the event object | |
* @param {HTMLNode} node The node to fire the event handler on. | |
* @param {String} eventName The name of the event without the "on" (e.g., "focus") | |
*/ | |
function fireEvent(node, eventName) { | |
// Make sure we use the ownerDocument from the provided node to avoid cross-window problems | |
var doc; | |
if (node.ownerDocument) { |
const chopStyle2Num = style => Number(style.substr(0, style.length - 2)); | |
const closestParent = (element, tagName) => { | |
let parentNode = element.parentNode; | |
while (parentNode.nodeName.toLowerCase() !== tagName) { | |
parentNode = parentNode.parentNode; | |
if (parentNode === document.body) { |
// Flyweight.js - Copyright Addy Osmani, 2012. | |
// Consider public domain | |
// My implementation in JS of this: | |
// http://en.wikipedia.org/wiki/Flyweight_pattern | |
// Simulate pure virtual inheritance/'implement' keyword for JS | |
Function.prototype.implementsFor = function (parentClassOrObject) { | |
if (parentClassOrObject.constructor == Function) { | |
// Normal Inheritance | |
this.prototype = new parentClassOrObject; |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>