Commit c271aac6 by Tuukka Kivilahti

stuffendalen, siirto koneelta toiselle

1 parent 73bb04a9
{
"/MoyaWeb": {
"target": "http://localhost:8080",
"secure": false
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginDialogComponent } from './login-dialog.component';
describe('LoginDialogComponent', () => {
let component: LoginDialogComponent;
let fixture: ComponentFixture<LoginDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'moya-login-dialog',
templateUrl: './login-dialog.component.html',
styleUrls: ['./login-dialog.component.css']
})
export class LoginDialogComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<mat-card>
<mat-card-title>
<mat-toolbar color="primary">
<h1>{{ 'login.title' | translate }}</h1>
</mat-toolbar>
</mat-card-title>
<mat-card-content>
<moya-login (loginEvent)="onLoginEvent($event)" ></moya-login>
</mat-card-content>
</mat-card>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginPageComponent } from './login-page.component';
describe('LoginPageComponent', () => {
let component: LoginPageComponent;
let fixture: ComponentFixture<LoginPageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginPageComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router";
@Component({
selector: 'moya-login-page',
templateUrl: './login-page.component.html',
styleUrls: ['./login-page.component.css']
})
export class LoginPageComponent implements OnInit {
constructor(private router: Router) { }
ngOnInit() {
}
onLoginEvent(success: boolean):void {
if(success) {
this.router.navigateByUrl("/");
}
}
}
{
"/MoyaWeb": {
"target": "https://ng.test.moya.fi",
"secure": true,
"headers": {"host":"ng.test.moya.fi" }
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!