mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
# add dist
This commit is contained in:
39
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/bindAll.js
generated
vendored
Normal file
39
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/bindAll.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var arrayEach = require('./_arrayEach'),
|
||||
baseFlatten = require('./_baseFlatten'),
|
||||
bind = require('./bind'),
|
||||
rest = require('./rest');
|
||||
|
||||
/**
|
||||
* Binds methods of an object to the object itself, overwriting the existing
|
||||
* method.
|
||||
*
|
||||
* **Note:** This method doesn't set the "length" property of bound functions.
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {Object} object The object to bind and assign the bound methods to.
|
||||
* @param {...(string|string[])} methodNames The object method names to bind.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() {
|
||||
* console.log('clicked ' + this.label);
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view, 'onClick');
|
||||
* jQuery(element).on('click', view.onClick);
|
||||
* // => Logs 'clicked docs' when clicked.
|
||||
*/
|
||||
var bindAll = rest(function(object, methodNames) {
|
||||
arrayEach(baseFlatten(methodNames, 1), function(key) {
|
||||
object[key] = bind(object[key], object);
|
||||
});
|
||||
return object;
|
||||
});
|
||||
|
||||
module.exports = bindAll;
|
Reference in New Issue
Block a user