diff options
| author | Illniyar | 2013-04-20 23:33:40 +0300 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-08 10:07:24 +0100 |
| commit | 1240641f765f7bcef8c6050fd04e9c4530b9e0c2 (patch) | |
| tree | 91b88a17af5719713d75c2bda4dd4655a1e82ddd /src/ngCookies/cookies.js | |
| parent | f1a34f0908cf3629da4f97b20d0c77e315e93cb5 (diff) | |
| download | angular.js-1240641f765f7bcef8c6050fd04e9c4530b9e0c2.tar.bz2 | |
feat($cookieStore): $cookieStore.get now parses blank string as blank string
closes #1918
Diffstat (limited to 'src/ngCookies/cookies.js')
| -rw-r--r-- | src/ngCookies/cookies.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ngCookies/cookies.js b/src/ngCookies/cookies.js index 8b46973f..68355707 100644 --- a/src/ngCookies/cookies.js +++ b/src/ngCookies/cookies.js @@ -139,7 +139,8 @@ angular.module('ngCookies', ['ng']). * @returns {Object} Deserialized cookie value. */ get: function(key) { - return angular.fromJson($cookies[key]); + var value = $cookies[key]; + return value ? angular.fromJson(value) : value; }, /** |
