UNPKG

4.25 kBSource Map (JSON)View Raw
1{"version":3,"file":"register.component.js","sourceRoot":"","sources":["../../../../../../.ng_build/auth/components/register/register.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAU5D,MAAM,OAAO,mBAAmB;IAY9B,YAAsB,OAAsB,EACG,UAAU,EAAE,EACrC,EAAqB,EACrB,MAAc;QAHd,YAAO,GAAP,OAAO,CAAe;QACG,YAAO,GAAP,OAAO,CAAK;QACrC,OAAE,GAAF,EAAE,CAAmB;QACrB,WAAM,GAAN,MAAM,CAAQ;QAbpC,kBAAa,GAAW,CAAC,CAAC;QAC1B,iBAAY,GAAQ,EAAE,CAAC;QACvB,aAAQ,GAAW,EAAE,CAAC;QAEtB,cAAS,GAAG,KAAK,CAAC;QAClB,WAAM,GAAa,EAAE,CAAC;QACtB,aAAQ,GAAa,EAAE,CAAC;QACxB,SAAI,GAAQ,EAAE,CAAC;QACf,gBAAW,GAAuB,EAAE,CAAC;QAOnC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,8BAA8B,CAAC,CAAC;QACzE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;QAC/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;IACpE,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAoB,EAAE,EAAE;YACjF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;gBACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;aACtC;iBAAM;gBACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;aAClC;YAED,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACtC,IAAI,QAAQ,EAAE;gBACZ,UAAU,CAAC,GAAG,EAAE;oBACd,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAC7C,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;aACxB;YACD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,GAAW;QACxB,OAAO,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;;;YArDF,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;gBAEvB,8mOAAwC;gBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YATQ,aAAa;4CAuBP,MAAM,SAAC,eAAe;YA5BH,iBAAiB;YAC1C,MAAM","sourcesContent":["/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { NB_AUTH_OPTIONS, NbAuthSocialLink } from '../../auth.options';\nimport { getDeepFromObject } from '../../helpers';\n\nimport { NbAuthService } from '../../services/auth.service';\nimport { NbAuthResult } from '../../services/auth-result';\n\n\n@Component({\n selector: 'nb-register',\n styleUrls: ['./register.component.css'],\n templateUrl: './register.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NbRegisterComponent {\n\n redirectDelay: number = 0;\n showMessages: any = {};\n strategy: string = '';\n\n submitted = false;\n errors: string[] = [];\n messages: string[] = [];\n user: any = {};\n socialLinks: NbAuthSocialLink[] = [];\n\n constructor(protected service: NbAuthService,\n @Inject(NB_AUTH_OPTIONS) protected options = {},\n protected cd: ChangeDetectorRef,\n protected router: Router) {\n\n this.redirectDelay = this.getConfigValue('forms.register.redirectDelay');\n this.showMessages = this.getConfigValue('forms.register.showMessages');\n this.strategy = this.getConfigValue('forms.register.strategy');\n this.socialLinks = this.getConfigValue('forms.login.socialLinks');\n }\n\n register(): void {\n this.errors = this.messages = [];\n this.submitted = true;\n\n this.service.register(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false;\n if (result.isSuccess()) {\n this.messages = result.getMessages();\n } else {\n this.errors = result.getErrors();\n }\n\n const redirect = result.getRedirect();\n if (redirect) {\n setTimeout(() => {\n return this.router.navigateByUrl(redirect);\n }, this.redirectDelay);\n }\n this.cd.detectChanges();\n });\n }\n\n getConfigValue(key: string): any {\n return getDeepFromObject(this.options, key, null);\n }\n}\n"]}
\No newline at end of file