1 | "use strict";
|
2 | var __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 | };
|
8 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10 | };
|
11 | var core_1 = require('@angular/core');
|
12 | var router_1 = require('@angular/router');
|
13 | var common_1 = require('@angular/common');
|
14 | var StepsUtils = (function () {
|
15 | function StepsUtils(router, location) {
|
16 | this.router = router;
|
17 | this.location = location;
|
18 | }
|
19 | StepsUtils.prototype.disableElement = function (el, renderer) {
|
20 | renderer.setElementAttribute(el.nativeElement, 'disabled', '');
|
21 | };
|
22 | StepsUtils.prototype.appendRouteLink = function (el, renderer, routeLink) {
|
23 | renderer.setElementAttribute(el.nativeElement, 'href', routeLink);
|
24 | };
|
25 | StepsUtils.prototype.createAbsoluteLink = function (newRoute, currentRoute) {
|
26 | var tree = this.router.createUrlTree([newRoute], { relativeTo: currentRoute });
|
27 | var asUrl = this.router.serializeUrl(tree);
|
28 | return this.location.prepareExternalUrl(asUrl);
|
29 | };
|
30 | StepsUtils = __decorate([
|
31 | core_1.Injectable(),
|
32 | __metadata('design:paramtypes', [router_1.Router, common_1.LocationStrategy])
|
33 | ], StepsUtils);
|
34 | return StepsUtils;
|
35 | }());
|
36 | exports.StepsUtils = StepsUtils;
|
37 |
|
\ | No newline at end of file |