UNPKG

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