From 7634a3ed5227f8bc2a2ba83752d0e2c78adb6051 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 18 Mar 2010 12:20:06 -0700 Subject: initial revision of new plugable compiler --- src/Angular.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index 9b3634be..39a6e91d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -24,9 +24,14 @@ var consoleNode, msie, jQuery = window['jQuery'] || window['$'], // weirdness to make IE happy foreach = _.each, extend = _.extend, + slice = Array.prototype.slice, identity = _.identity, angular = window['angular'] || (window['angular'] = {}), angularValidator = angular['validator'] || (angular['validator'] = {}), + angularDirective = angular['directive'] || (angular['directive'] = function(name, fn){ + if (fn) {angularDirective[name] = fn;}; + return angularDirective[name]; + }), angularFilter = angular['filter'] || (angular['filter'] = {}), angularFormatter = angular['formatter'] || (angular['formatter'] = {}), angularCallbacks = angular['callbacks'] || (angular['callbacks'] = {}), @@ -37,7 +42,7 @@ angular['copy'] = copy; var isVisible = isVisible || function (element) { return jQuery(element).is(":visible"); -} +}; function log(a, b, c){ var console = window['console']; @@ -154,12 +159,13 @@ function escapeAttr(html) { } function bind(_this, _function) { + var curryArgs = slice.call(arguments, 2, arguments.length); if (!_this) throw "Missing this"; if (!_.isFunction(_function)) throw "Missing function"; return function() { - return _function.apply(_this, arguments); + return _function.apply(_this, curryArgs.concat(slice.call(arguments, 0, arguments.length))); }; } -- cgit v1.2.3