UNPKG

1.81 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8Object.defineProperty(exports, "__esModule", { value: true });
9var aurelia_templating_1 = require("aurelia-templating");
10var aurelia_dependency_injection_1 = require("aurelia-dependency-injection");
11var aurelia_logging_1 = require("aurelia-logging");
12var aurelia_pal_1 = require("aurelia-pal");
13/**
14 * Attribute to be placed on any element to have it emit the View Compiler's
15 * TargetInstruction into the debug console, giving you insight into all the
16 * parsed bindings, behaviors and event handers for the targeted element.
17 */
18var CompileSpy = /** @class */ (function () {
19 /**
20 * Creates and instanse of CompileSpy.
21 * @param element target element on where attribute is placed on.
22 * @param instruction instructions for how the target element should be enhanced.
23 */
24 function CompileSpy(element, instruction) {
25 aurelia_logging_1.getLogger('compile-spy').info(element.toString(), instruction);
26 }
27 CompileSpy = __decorate([
28 aurelia_templating_1.customAttribute('compile-spy'),
29 aurelia_dependency_injection_1.inject(aurelia_pal_1.DOM.Element, aurelia_templating_1.TargetInstruction)
30 ], CompileSpy);
31 return CompileSpy;
32}());
33exports.CompileSpy = CompileSpy;