diff options
| author | Misko Hevery | 2010-03-18 12:20:06 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-03-18 12:20:06 -0700 |
| commit | 7634a3ed5227f8bc2a2ba83752d0e2c78adb6051 (patch) | |
| tree | ef94843f25eae83d0492b18149a084868829693c /src/Angular.js | |
| parent | f1b50b92ac69f5c58984f5e88015507552d29df2 (diff) | |
| download | angular.js-7634a3ed5227f8bc2a2ba83752d0e2c78adb6051.tar.bz2 | |
initial revision of new plugable compiler
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 10 |
1 files changed, 8 insertions, 2 deletions
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))); }; } |
