All files / src/helpers ControlNameResolver.js

0% Statements 0/15
0% Branches 0/9
0% Functions 0/2
0% Lines 0/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                               
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const aurelia_framework_1 = require("aurelia-framework");
class ControlNameResolver {
    static getNameForControl(control) {
        let found = null;
        if (!control || !control.name || !control.name.length) {
            return null;
        }
        if (this.nameCache[control.name] !== undefined) {
            return this.nameCache[control.name];
        }
        aurelia_framework_1.PLATFORM.eachModule((m, v) => {
            if (v[control.name] === control)
                found = m;
            return true;
        });
        this.nameCache[control.name] = found;
        return found;
    }
}
ControlNameResolver.nameCache = [];
exports.ControlNameResolver = ControlNameResolver;
//# sourceMappingURL=ControlNameResolver.js.map