MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / jqLiteData

Function jqLiteData

code/songhop/www/lib/angular/angular.js:2580–2604  ·  view source on GitHub ↗
(element, key, value)

Source from the content-addressed store, hash-verified

2578
2579
2580function jqLiteData(element, key, value) {
2581 if (jqLiteAcceptsData(element)) {
2582
2583 var isSimpleSetter = isDefined(value);
2584 var isSimpleGetter = !isSimpleSetter && key && !isObject(key);
2585 var massGetter = !key;
2586 var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
2587 var data = expandoStore && expandoStore.data;
2588
2589 if (isSimpleSetter) { // data('key', value)
2590 data[key] = value;
2591 } else {
2592 if (massGetter) { // data()
2593 return data;
2594 } else {
2595 if (isSimpleGetter) { // data('key')
2596 // don't force creation of expandoStore if it doesn't exist yet
2597 return data && data[key];
2598 } else { // mass-setter: data({key1: val1, key2: val2})
2599 extend(data, key);
2600 }
2601 }
2602 }
2603 }
2604}
2605
2606function jqLiteHasClass(element, selector) {
2607 if (!element.getAttribute) return false;

Callers

nothing calls this directly

Calls 5

jqLiteAcceptsDataFunction · 0.70
isDefinedFunction · 0.70
isObjectFunction · 0.70
jqLiteExpandoStoreFunction · 0.70
extendFunction · 0.70

Tested by

no test coverage detected