webpackJsonp([37],{

/***/ 1493:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoginPageModule", function() { return LoginPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__login__ = __webpack_require__(1791);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ngx_translate_core__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_core__ = __webpack_require__(0);
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;
};
/**
 * Created by shadeeka on 1/10/18.
 */




var LoginPageModule = /** @class */ (function () {
    function LoginPageModule() {
    }
    LoginPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_3__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_0__login__["a" /* LoginPage */]
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_0__login__["a" /* LoginPage */]),
                __WEBPACK_IMPORTED_MODULE_2__ngx_translate_core__["b" /* TranslateModule */].forChild()
            ],
            exports: [
                __WEBPACK_IMPORTED_MODULE_0__login__["a" /* LoginPage */]
            ]
        })
    ], LoginPageModule);
    return LoginPageModule;
}());

//# sourceMappingURL=login.module.js.map

/***/ }),

/***/ 1791:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LoginPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_forms__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__ncinga_sp_nsp_app_core_dist_providers_app_state__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_auth_auth_provider__ = __webpack_require__(91);
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);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};




var LoginPage = /** @class */ (function () {
    function LoginPage(authService, appSvc) {
        this.authService = authService;
        this.appSvc = appSvc;
        this.login = {};
        this.submitted = false;
        this.error = false;
        this.loginProgress = false;
    }
    LoginPage.prototype.ngAfterViewInit = function () {
    };
    LoginPage.prototype.doLogin = function () {
        var _this = this;
        this.submitted = true;
        if (this.form.valid) {
            this.loginProgress = true;
            this.authService.login(this.login.username, this.login.password).subscribe(function (result) {
                _this.loginProgress = false;
                /*TODO: use event to communicate successfull login*/
                _this.login['time'] = new Date().getTime();
                _this.appSvc.notifyDataChanged('LOGIN_SUCCESSFUL', JSON.stringify(_this.login));
            }, function (error) {
                _this.loginProgress = false;
                _this.error = true;
            });
        }
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_1__angular_forms__["NgForm"]),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1__angular_forms__["NgForm"])
    ], LoginPage.prototype, "form", void 0);
    LoginPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-login',template:/*ion-inline-start:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/login/login.html"*/'<!-- Login\n================================================-->\n<ion-content padding>\n\n  <ion-grid>\n    <ion-row>\n      <ion-col col-sm-6 col-md-4 push-md-6 push-sm-3>\n        <div class="login-logo">\n          <a><img src="assets/login/nfactory-logo.png" alt="Product Logo"></a>\n        </div>\n        <div class="login-box clearfix animated flipInY">\n          <div class="login-header">\n            SIGN IN\n          </div>\n          <hr>\n          <div class="login-form">\n            <!-- Start Error box -->\n            <!-- End Error box -->\n            <form #loginForm="ngForm">\n              <input type="text" placeholder="User name" class="input-field" [(ngModel)]="login.username"\n                     name="username" type="text" #username="ngModel" spellcheck="false" autocapitalize="off" required>\n              <p [hidden]="username.valid || submitted == false" color="danger" class="error-msg" padding-left>\n                Username is required\n              </p>\n              <input type="password" placeholder="Password" class="input-field" [(ngModel)]="login.password"\n                     name="password" type="password" #password="ngModel" required>\n              <p [hidden]="password.valid || submitted == false" color="danger" class="error-msg" padding-left>\n                Password is required\n              </p>\n              <button ion-button type="submit" [disabled]="loginProgress" class="btn btn-login" (click)="doLogin()">Login</button>\n            </form>\n            <div class="pad-all ">\n              <div class="media pad-top bord-top error-msg">\n                <div [hidden]="error == false" class="media-body text-center " color="danger" >\n                  <p>Error !! Invalid <b>username</b> or <b>password</b>.</p>\n                </div>\n              </div>\n            </div>\n            <div class="bubblingG" [hidden]="loginProgress == false">\n              <span id="bubblingG_1"></span>\n              <span id="bubblingG_2"></span>\n              <span id="bubblingG_3"></span>\n            </div>\n          </div>\n        </div>\n        <div class="login-logo-company">\n          <a><img src="assets/img/ncinga-logo.png" alt="Company Logo"></a>\n        </div>\n\n      </ion-col>\n    </ion-row>\n  </ion-grid>\n\n</ion-content>\n'/*ion-inline-end:"/disk1/jenkins/workspace/ncinga_spark_installation_apk/src/pages/login/login.html"*/
        }),
        __param(0, Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Inject"])(__WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_auth_auth_provider__["a" /* AuthProvider */])),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_3__ncinga_sp_nsp_app_core_dist_auth_auth_provider__["a" /* AuthProvider */], __WEBPACK_IMPORTED_MODULE_2__ncinga_sp_nsp_app_core_dist_providers_app_state__["a" /* ApplicationService */]])
    ], LoginPage);
    return LoginPage;
}());

//# sourceMappingURL=login.js.map

/***/ })

});
//# sourceMappingURL=37.js.map