smart-house-frontend
Version:
1 lines • 28.3 kB
Source Map (JSON)
{"version":3,"sources":["webpack:///5.5.bundle.js","webpack:///./app/login/login.module.ts","webpack:///./app/login/login.component.ts","webpack:///./app/login/login.component.scss","webpack:///./app/login/login.component.html","webpack:///./app/login/fb-callback.component.ts","webpack:///./app/login/fb-callback.component.html","webpack:///./app/login/login.routing.ts"],"names":["webpackJsonp","602","module","exports","__webpack_require__","__decorate","this","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__metadata","k","v","metadata","core_1","forms_1","shared_module_1","login_component_1","fb_callback_component_1","login_routing_1","LoginModule","NgModule","id","imports","SharedModule","FormsModule","routing","providers","declarations","LoginComponent","FbCallbackComponent","603","router_1","common_1","auth_service_1","window_ref_service_1","FB_LOGIN_URL_PATH","FB_LOGIN_REDIRECT_PARAM","FB_LOGIN_CALLBACK_NAV_URL","auth","router","activateRoute","location","windowRef","_this","credentials","email","password","loggingError","fbLoggingError","params","subscribe","prototype","login","loginSubscription","navigate","loginFb","nativeWindow","href","encodeURIComponent","origin","prepareExternalUrl","ngOnDestroy","unsubscribe","Component","selector","styles","template","_a","AuthService","_b","Router","_c","ActivatedRoute","_d","Location","_e","WindowRef","604","605","606","FB_LOGIN_SUCCESS_ROUTE","FB_LOGIN_ERROR_ROUTE","authService","ngOnInit","accessToken","parseAccessToken","subscription","loginByAccessToken","locationHash","hash","substring","match","RegExp","607","608","routes","path","component","RouterModule","forChild"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAASC,EAAQC,EAASC,GAE/B,YACA,IAAIC,GAAcC,MAAQA,KAAKD,YAAe,SAAUE,EAAYC,EAAQC,EAAKC,GAC7E,GAA2HC,GAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,CACrH,IAAuB,gBAAZQ,UAAoD,kBAArBA,SAAQC,SAAyBJ,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5Y0B,EAEH,IAAIsC,GAAIE,EAAIE,IKnLJjF,GAAAuC,oBAAmBA,GL0L1BgE,IACA,SAASxG,EAAQC,GMxMvBD,EAAAC,QAAA,uBN8MMwG,IACA,SAASzG,EAAQC,EAASC,GAE/B,YOjND,IAAAwC,GAAAxC,EAA6B,IAE7ByB,EAAAzB,EAA+B,KAC/B0B,EAAA1B,EAAoC,IAEvBD,GAAAyG,SACPC,KAAM,GAAIC,UAAWjF,EAAAY,iBACrBoE,KAAM,eAAgBC,UAAWjF,EAAAY,iBACjCoE,KAAM,cAAeC,UAAWhF,EAAAY,sBAGzBvC,EAAAmC,QAAUM,EAAAmE,aAAaC,SAAS7G,EAAAyG","file":"5.5.bundle.js","sourcesContent":["webpackJsonp([5],{\n\n/***/ 602:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t 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;\n\t return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar forms_1 = __webpack_require__(389);\n\tvar shared_module_1 = __webpack_require__(387);\n\tvar login_component_1 = __webpack_require__(603);\n\tvar fb_callback_component_1 = __webpack_require__(606);\n\tvar login_routing_1 = __webpack_require__(608);\n\tvar LoginModule = (function () {\n\t function LoginModule() {\n\t }\n\t LoginModule = __decorate([\n\t core_1.NgModule({\n\t id: module.id,\n\t imports: [shared_module_1.SharedModule, forms_1.FormsModule, login_routing_1.routing],\n\t providers: [],\n\t declarations: [\n\t login_component_1.LoginComponent,\n\t fb_callback_component_1.FbCallbackComponent\n\t ]\n\t }), \n\t __metadata('design:paramtypes', [])\n\t ], LoginModule);\n\t return LoginModule;\n\t}());\n\texports.LoginModule = LoginModule;\n\n\n/***/ },\n\n/***/ 603:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t 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;\n\t return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar router_1 = __webpack_require__(29);\n\tvar common_1 = __webpack_require__(22);\n\tvar auth_service_1 = __webpack_require__(77);\n\tvar window_ref_service_1 = __webpack_require__(383);\n\tvar FB_LOGIN_URL_PATH = '/auth/login-facebook';\n\tvar FB_LOGIN_REDIRECT_PARAM = 'redirect_uri';\n\tvar FB_LOGIN_CALLBACK_NAV_URL = '/login/fb-callback';\n\tvar LoginComponent = (function () {\n\t function LoginComponent(auth, router, activateRoute, location, windowRef) {\n\t var _this = this;\n\t this.auth = auth;\n\t this.router = router;\n\t this.activateRoute = activateRoute;\n\t this.location = location;\n\t this.windowRef = windowRef;\n\t this.credentials = {\n\t email: null,\n\t password: null\n\t };\n\t this.loggingError = false;\n\t this.fbLoggingError = false;\n\t this.activateRoute.params.subscribe(function (params) {\n\t _this.fbLoggingError = (params['error'] === 'fb');\n\t });\n\t }\n\t LoginComponent.prototype.login = function () {\n\t var _this = this;\n\t this.loginSubscription = this.auth.login(this.credentials)\n\t .subscribe(function () {\n\t _this.router.navigate(['/']);\n\t }, function () {\n\t _this.loggingError = true;\n\t });\n\t };\n\t LoginComponent.prototype.loginFb = function () {\n\t this.windowRef.nativeWindow.location.href =\n\t (FB_LOGIN_URL_PATH + \"?\" + FB_LOGIN_REDIRECT_PARAM + \"=\") + encodeURIComponent(this.windowRef.nativeWindow.location.origin +\n\t this.location.prepareExternalUrl(FB_LOGIN_CALLBACK_NAV_URL));\n\t };\n\t LoginComponent.prototype.ngOnDestroy = function () {\n\t if (this.loginSubscription) {\n\t this.loginSubscription.unsubscribe();\n\t }\n\t };\n\t LoginComponent = __decorate([\n\t core_1.Component({\n\t selector: 'sh-login',\n\t styles: [__webpack_require__(604)],\n\t template: __webpack_require__(605)\n\t }), \n\t __metadata('design:paramtypes', [(typeof (_a = typeof auth_service_1.AuthService !== 'undefined' && auth_service_1.AuthService) === 'function' && _a) || Object, (typeof (_b = typeof router_1.Router !== 'undefined' && router_1.Router) === 'function' && _b) || Object, (typeof (_c = typeof router_1.ActivatedRoute !== 'undefined' && router_1.ActivatedRoute) === 'function' && _c) || Object, (typeof (_d = typeof common_1.Location !== 'undefined' && common_1.Location) === 'function' && _d) || Object, (typeof (_e = typeof window_ref_service_1.WindowRef !== 'undefined' && window_ref_service_1.WindowRef) === 'function' && _e) || Object])\n\t ], LoginComponent);\n\t return LoginComponent;\n\t var _a, _b, _c, _d, _e;\n\t}());\n\texports.LoginComponent = LoginComponent;\n\n\n/***/ },\n\n/***/ 604:\n/***/ function(module, exports) {\n\n\tmodule.exports = \".btn{width:100%;margin:0 0 20px}.btn-facebook{background-color:#3b5998}.btn-facebook i{background:url(\\\"/assets/facebook.svg\\\") no-repeat;background-size:100%;display:inline-block;height:20px;width:20px;margin:2px 4px 4px 2px;vertical-align:middle}.validation-message-wrapper{position:relative;top:-10px}.validation-message{position:absolute}.input-field{position:relative}.input-field .validation-message{top:50px}\\n\"\n\n/***/ },\n\n/***/ 605:\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div class=\\\"row\\\">\\n <div class=\\\"col m3\\\"></div>\\n <div class=\\\"col m6 section\\\">\\n <h2>Login</h2><br />\\n <button (click)=\\\"loginFb($event)\\\" class=\\\"btn btn-facebook\\\">\\n <i></i>Login with Facebook\\n </button>\\n <div\\n [hidden]=\\\"!loggingError\\\"\\n class=\\\"validation-message-wrapper red-text text-darken-4\\\">\\n <div class=\\\"validation-message red-text text-darken-4\\\">\\n Email or password is invalid\\n </div>\\n </div>\\n <div\\n [hidden]=\\\"!fbLoggingError\\\"\\n class=\\\"validation-message-wrapper red-text text-darken-4\\\">\\n <div class=\\\"validation-message red-text text-darken-4\\\">\\n Facebook login error\\n </div>\\n </div>\\n <form\\n (ngSubmit)=\\\"login()\\\"\\n #loginForm=\\\"ngForm\\\">\\n <div class=\\\"input-field\\\">\\n <input\\n type=\\\"text\\\"\\n [(ngModel)]=\\\"credentials.email\\\"\\n #email=\\\"ngModel\\\"\\n name=\\\"email\\\"\\n placeholder=\\\"Email\\\"\\n required />\\n <div\\n [hidden]=\\\"!email.touched || email.valid\\\"\\n class=\\\"validation-message red-text text-darken-4\\\">\\n Email should be filled\\n </div>\\n </div>\\n <div class=\\\"input-field\\\">\\n <input\\n type=\\\"password\\\"\\n [(ngModel)]=\\\"credentials.password\\\"\\n #password=\\\"ngModel\\\"\\n name=\\\"password\\\"\\n placeholder=\\\"Password\\\"\\n required />\\n <div\\n [hidden]=\\\"!password.touched || password.valid\\\"\\n class=\\\"validation-message red-text text-darken-4\\\">\\n Password should be filled\\n </div>\\n </div>\\n <div class=\\\"input-field\\\">\\n <button\\n [disabled]=\\\"!loginForm.valid\\\"\\n type=\\\"submit\\\"\\n class=\\\"waves-effect waves-light btn blue-grey darken-1\\\">\\n Submit\\n </button>\\n </div>\\n <a [routerLink]=\\\"['/registration']\\\" class=\\\"btn btn-flat\\\">Click here to Registration</a>\\n </form>\\n </div>\\n <div class=\\\"col m3\\\"></div>\\n</div>\\n\"\n\n/***/ },\n\n/***/ 606:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t 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;\n\t return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar window_ref_service_1 = __webpack_require__(383);\n\tvar auth_service_1 = __webpack_require__(77);\n\tvar router_1 = __webpack_require__(29);\n\tvar FB_LOGIN_SUCCESS_ROUTE = '/';\n\tvar FB_LOGIN_ERROR_ROUTE = '/login/error/fb';\n\tvar FbCallbackComponent = (function () {\n\t function FbCallbackComponent(windowRef, authService, router) {\n\t this.windowRef = windowRef;\n\t this.authService = authService;\n\t this.router = router;\n\t }\n\t FbCallbackComponent.prototype.ngOnInit = function () {\n\t var _this = this;\n\t var accessToken = this.parseAccessToken();\n\t if (accessToken) {\n\t this.subscription = this.authService.loginByAccessToken(accessToken)\n\t .subscribe(function () {\n\t _this.router.navigate([FB_LOGIN_SUCCESS_ROUTE]);\n\t }, function () {\n\t _this.router.navigate([FB_LOGIN_ERROR_ROUTE]);\n\t });\n\t }\n\t else {\n\t this.router.navigate([FB_LOGIN_ERROR_ROUTE]);\n\t }\n\t };\n\t FbCallbackComponent.prototype.parseAccessToken = function () {\n\t var locationHash = this.windowRef.nativeWindow.location.hash.substring(1);\n\t var match = locationHash.match(new RegExp('access_token=([^&]+)', 'i'));\n\t if (!match) {\n\t return null;\n\t }\n\t return match[1];\n\t };\n\t FbCallbackComponent.prototype.ngOnDestroy = function () {\n\t if (this.subscription) {\n\t this.subscription.unsubscribe();\n\t }\n\t };\n\t FbCallbackComponent = __decorate([\n\t core_1.Component({\n\t selector: 'sh-fb-callback',\n\t template: __webpack_require__(607)\n\t }), \n\t __metadata('design:paramtypes', [(typeof (_a = typeof window_ref_service_1.WindowRef !== 'undefined' && window_ref_service_1.WindowRef) === 'function' && _a) || Object, (typeof (_b = typeof auth_service_1.AuthService !== 'undefined' && auth_service_1.AuthService) === 'function' && _b) || Object, (typeof (_c = typeof router_1.Router !== 'undefined' && router_1.Router) === 'function' && _c) || Object])\n\t ], FbCallbackComponent);\n\t return FbCallbackComponent;\n\t var _a, _b, _c;\n\t}());\n\texports.FbCallbackComponent = FbCallbackComponent;\n\n\n/***/ },\n\n/***/ 607:\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<p>Loading...</p>\\n\"\n\n/***/ },\n\n/***/ 608:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar router_1 = __webpack_require__(29);\n\tvar login_component_1 = __webpack_require__(603);\n\tvar fb_callback_component_1 = __webpack_require__(606);\n\texports.routes = [\n\t { path: '', component: login_component_1.LoginComponent },\n\t { path: 'error/:error', component: login_component_1.LoginComponent },\n\t { path: 'fb-callback', component: fb_callback_component_1.FbCallbackComponent }\n\t];\n\texports.routing = router_1.RouterModule.forChild(exports.routes);\n\n\n/***/ }\n\n});\n\n\n// WEBPACK FOOTER //\n// 5.5.bundle.js","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { SharedModule } from '../shared/shared.module';\n\nimport { LoginComponent } from './login.component';\nimport { FbCallbackComponent } from './fb-callback.component';\nimport { routing } from './login.routing';\n\n@NgModule({\n id: module.id,\n imports: [ SharedModule, FormsModule, routing ],\n providers: [],\n declarations: [\n LoginComponent,\n FbCallbackComponent\n ]\n})\nexport class LoginModule {}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/login/login.module.ts","import { Component, OnDestroy } from '@angular/core';\nimport { Router, ActivatedRoute, Params } from '@angular/router';\nimport { Location } from '@angular/common';\nimport { Subscription } from 'rxjs/Rx';\nimport { AuthService } from '../core/auth/auth.service';\nimport { IUserCredentials } from '../core/auth/auth.interfaces';\nimport { WindowRef } from '../core/browser/window-ref.service';\n\nconst FB_LOGIN_URL_PATH = '/auth/login-facebook';\nconst FB_LOGIN_REDIRECT_PARAM = 'redirect_uri';\nconst FB_LOGIN_CALLBACK_NAV_URL = '/login/fb-callback';\n\n@Component({\n selector: 'sh-login',\n styles: [require('./login.component.scss')],\n template: require('./login.component.html')\n})\nexport class LoginComponent implements OnDestroy {\n public credentials: IUserCredentials = {\n email: null,\n password: null\n };\n public loggingError: boolean = false;\n public fbLoggingError: boolean = false;\n private loginSubscription: Subscription;\n\n constructor(\n private auth: AuthService,\n private router: Router,\n private activateRoute: ActivatedRoute,\n private location: Location,\n private windowRef: WindowRef\n ) {\n\n this.activateRoute.params.subscribe((params: Params) => {\n this.fbLoggingError = (params['error'] === 'fb');\n });\n }\n\n login() {\n this.loginSubscription = this.auth.login(this.credentials)\n .subscribe(() => {\n this.router.navigate(['/']);\n }, () => {\n this.loggingError = true;\n });\n }\n\n loginFb() {\n this.windowRef.nativeWindow.location.href =\n `${FB_LOGIN_URL_PATH}?${FB_LOGIN_REDIRECT_PARAM}=` + encodeURIComponent(\n this.windowRef.nativeWindow.location.origin +\n this.location.prepareExternalUrl(FB_LOGIN_CALLBACK_NAV_URL)\n );\n }\n\n ngOnDestroy() {\n if (this.loginSubscription) {\n this.loginSubscription.unsubscribe();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/login/login.component.ts","module.exports = \".btn{width:100%;margin:0 0 20px}.btn-facebook{background-color:#3b5998}.btn-facebook i{background:url(\\\"/assets/facebook.svg\\\") no-repeat;background-size:100%;display:inline-block;height:20px;width:20px;margin:2px 4px 4px 2px;vertical-align:middle}.validation-message-wrapper{position:relative;top:-10px}.validation-message{position:absolute}.input-field{position:relative}.input-field .validation-message{top:50px}\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/login/login.component.scss\n// module id = 604\n// module chunks = 5","module.exports = \"<div class=\\\"row\\\">\\n <div class=\\\"col m3\\\"></div>\\n <div class=\\\"col m6 section\\\">\\n <h2>Login</h2><br />\\n <button (click)=\\\"loginFb($event)\\\" class=\\\"btn btn-facebook\\\">\\n <i></i>Login with Facebook\\n </button>\\n <div\\n [hidden]=\\\"!loggingError\\\"\\n class=\\\"validation-message-wrapper red-text text-darken-4\\\">\\n <div class=\\\"validation-message red-text text-darken-4\\\">\\n Email or password is invalid\\n </div>\\n </div>\\n <div\\n [hidden]=\\\"!fbLoggingError\\\"\\n class=\\\"validation-message-wrapper red-text text-darken-4\\\">\\n <div class=\\\"validation-message red-text text-darken-4\\\">\\n Facebook login error\\n </div>\\n </div>\\n <form\\n (ngSubmit)=\\\"login()\\\"\\n #loginForm=\\\"ngForm\\\">\\n <div class=\\\"input-field\\\">\\n <input\\n type=\\\"text\\\"\\n [(ngModel)]=\\\"credentials.email\\\"\\n #email=\\\"ngModel\\\"\\n name=\\\"email\\\"\\n placeholder=\\\"Email\\\"\\n required />\\n <div\\n [hidden]=\\\"!email.touched || email.valid\\\"\\n class=\\\"validation-message red-text text-darken-4\\\">\\n Email should be filled\\n </div>\\n </div>\\n <div class=\\\"input-field\\\">\\n <input\\n type=\\\"password\\\"\\n [(ngModel)]=\\\"credentials.password\\\"\\n #password=\\\"ngModel\\\"\\n name=\\\"password\\\"\\n placeholder=\\\"Password\\\"\\n required />\\n <div\\n [hidden]=\\\"!password.touched || password.valid\\\"\\n class=\\\"validation-message red-text text-darken-4\\\">\\n Password should be filled\\n </div>\\n </div>\\n <div class=\\\"input-field\\\">\\n <button\\n [disabled]=\\\"!loginForm.valid\\\"\\n type=\\\"submit\\\"\\n class=\\\"waves-effect waves-light btn blue-grey darken-1\\\">\\n Submit\\n </button>\\n </div>\\n <a [routerLink]=\\\"['/registration']\\\" class=\\\"btn btn-flat\\\">Click here to Registration</a>\\n </form>\\n </div>\\n <div class=\\\"col m3\\\"></div>\\n</div>\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/login/login.component.html\n// module id = 605\n// module chunks = 5","import { Component, OnInit, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { WindowRef } from '../core/browser/window-ref.service';\nimport { AuthService } from '../core/auth/auth.service';\nimport { Router } from '@angular/router';\n\nconst FB_LOGIN_SUCCESS_ROUTE = '/';\nconst FB_LOGIN_ERROR_ROUTE = '/login/error/fb';\n\n@Component({\n selector: 'sh-fb-callback',\n template: require('./fb-callback.component.html')\n})\nexport class FbCallbackComponent implements OnInit, OnDestroy {\n private subscription: Subscription;\n\n constructor(\n private windowRef: WindowRef,\n private authService: AuthService,\n private router: Router\n ) {}\n\n ngOnInit() {\n const accessToken = this.parseAccessToken();\n\n if (accessToken) {\n this.subscription = this.authService.loginByAccessToken(accessToken)\n .subscribe(() => {\n this.router.navigate([FB_LOGIN_SUCCESS_ROUTE]);\n }, () => {\n this.router.navigate([FB_LOGIN_ERROR_ROUTE]);\n });\n } else {\n this.router.navigate([FB_LOGIN_ERROR_ROUTE]);\n }\n }\n\n parseAccessToken(): string {\n const locationHash = this.windowRef.nativeWindow.location.hash.substring(1);\n const match = locationHash.match(new RegExp('access_token=([^&]+)', 'i'));\n\n if (!match) {\n return null;\n }\n\n return match[1];\n }\n\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/login/fb-callback.component.ts","module.exports = \"<p>Loading...</p>\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/login/fb-callback.component.html\n// module id = 607\n// module chunks = 5","import { RouterModule } from '@angular/router';\n\nimport { LoginComponent } from './login.component';\nimport { FbCallbackComponent } from './fb-callback.component';\n\nexport const routes = [\n { path: '', component: LoginComponent },\n { path: 'error/:error', component: LoginComponent },\n { path: 'fb-callback', component: FbCallbackComponent }\n];\n\nexport const routing = RouterModule.forChild(routes);\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/login/login.routing.ts"],"sourceRoot":""}