diff options
| author | Misko Hevery | 2010-04-01 14:10:28 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-01 14:10:28 -0700 |
| commit | 85f13d602e31424b2e2d18172872f14a24c31135 (patch) | |
| tree | 8389ab1a0dfd6b8717a1f0dc70a738deaca146c2 /src/Angular.js | |
| parent | 11a6431f8926c557f3c58408dacc98466e76cde1 (diff) | |
| download | angular.js-85f13d602e31424b2e2d18172872f14a24c31135.tar.bz2 | |
work on $location and autobind
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 72ff26b0..5b5aa87b 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -45,7 +45,7 @@ UrlWatcher.prototype = { } }; - +//////////////////////////////////// if (typeof document.getAttribute == 'undefined') document.getAttribute = function() {}; @@ -386,3 +386,20 @@ function compile(element, config) { } ///////////////////////////////////////////////// +function parseKeyValue(keyValue) { + var obj = {}, key_value, key; + foreach((keyValue || "").split('&'), function(keyValue){ + if (keyValue) { + key_value = keyValue.split('='); + key = decodeURIComponent(key_value[0]); + obj[key] = key_value[1] ? decodeURIComponent(key_value[1]) : true; + } + }); + return obj; +} + +function angularInit(config){ + if (config.autobind) { + compile(window.document, config).$init(); + } +} |
