aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorJeff Cross2013-05-29 13:44:59 -0700
committerMisko Hevery2013-05-30 23:43:27 -0700
commite1a050e6b26aca4d0e6e7125d3f6c1c8fc1d92cb (patch)
treee103549e9287a389742d57f04db0cc6f65f171f8 /src/jqLite.js
parenta4b9a6aca9a0d4b1e3be2238cf549083776284ba (diff)
downloadangular.js-e1a050e6b26aca4d0e6e7125d3f6c1c8fc1d92cb.tar.bz2
fix(jqLite): Added optional name arg in removeData
jQuery's API for removeData allows a second 'name' argument to just remove the property by that name from an element's data. The absence of this argument was causing some features not to work correctly when combining multiple directives, such as ng-click, ng-show, and ng-animate.
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 4959a2ed..4c68cdef 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -204,11 +204,16 @@ function JQLiteUnbind(element, type, fn) {
}
}
-function JQLiteRemoveData(element) {
+function JQLiteRemoveData(element, name) {
var expandoId = element[jqName],
expandoStore = jqCache[expandoId];
if (expandoStore) {
+ if (name) {
+ delete jqCache[expandoId].data[name];
+ return;
+ }
+
if (expandoStore.handle) {
expandoStore.events.$destroy && expandoStore.handle({}, '$destroy');
JQLiteUnbind(element);