UNPKG

@akveo/nga-auth

Version:
42 lines 2.01 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; /** * @license * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ import { Component } from '@angular/core'; import { NgaAuthService } from '../services/auth.service'; var NgaAuthComponent = (function () { // showcase of how to use the onAuthenticationChange method function NgaAuthComponent(auth) { var _this = this; this.auth = auth; this.authenticated = false; this.token = ''; this.subscription = auth.onAuthenticationChange() .subscribe(function (authenticated) { _this.authenticated = authenticated; }); } NgaAuthComponent.prototype.ngOnDestroy = function () { this.subscription.unsubscribe(); }; return NgaAuthComponent; }()); NgaAuthComponent = __decorate([ Component({ selector: 'nga-auth', template: "\n <nga-layout>\n <nga-layout-column>\n <nga-auth-block></nga-auth-block>\n </nga-layout-column>\n </nga-layout>\n ", }), __metadata("design:paramtypes", [NgaAuthService]) ], NgaAuthComponent); export { NgaAuthComponent }; //# sourceMappingURL=auth.component.js.map