Commit 8c92f8dd by Tuukka Kivilahti

hä, ei nää puuttunut sieltä

1 parent 98b865fd
"use strict";
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 core_1 = require('@angular/core');
var AppComponent = (function () {
function AppComponent(router, zone) {
this.router = router;
this.zone = zone;
this.counter = 4;
this.title = 'app works!';
window.angularRoute = (function (url) {
zone.run(function () {
router.navigateByUrl(url);
});
});
// Enable change detection sometimes to see that it's not overflooded.
// bcause it takes time
//zone.onMicrotaskEmpty.subscribe(() => {console.log(".");}); // <-- Print "." everytime change detection is possibly
}
AppComponent = __decorate([
core_1.Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
], AppComponent);
return AppComponent;
}());
exports.AppComponent = AppComponent;
"use strict";
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 platform_browser_1 = require('@angular/platform-browser');
var core_1 = require('@angular/core');
var forms_1 = require('@angular/forms');
var http_1 = require('@angular/http');
var app_component_1 = require('./app.component');
var viplist_component_1 = require('./viplist/viplist.component');
var ng2_bootstrap_1 = require("ng2-bootstrap");
var moya_angular_common_1 = require("moya-angular-common");
var router_1 = require('@angular/router');
var test_component_1 = require("./test/test.component");
var old_moya_component_1 = require('./old-moya/old-moya.component');
var safe_pipe_1 = require('./safe.pipe');
var appRoutes = [
{ path: 'vip/viplist', component: viplist_component_1.ViplistComponent },
{ path: 'test', component: test_component_1.TestComponent },
{ path: 'old', component: old_moya_component_1.OldMoyaComponent }
];
var AppModule = (function () {
function AppModule() {
}
AppModule = __decorate([
core_1.NgModule({
declarations: [
app_component_1.AppComponent,
viplist_component_1.ViplistComponent,
test_component_1.TestComponent,
old_moya_component_1.OldMoyaComponent,
safe_pipe_1.SafePipe,
],
imports: [
platform_browser_1.BrowserModule,
forms_1.FormsModule,
http_1.HttpModule,
ng2_bootstrap_1.AlertModule.forRoot(),
moya_angular_common_1.MoyaRestModule.forRoot(),
router_1.RouterModule.forRoot(appRoutes)
],
providers: [],
bootstrap: [app_component_1.AppComponent]
})
], AppModule);
return AppModule;
}());
exports.AppModule = AppModule;
<iframe [src]="frameUrl | safe" width="100%" [height]="height" #iframe (load)="changeUrl()" frameborder="0"></iframe><br />
"use strict";
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 core_1 = require('@angular/core');
var common_1 = require("@angular/common");
var OldMoyaComponent = (function () {
function OldMoyaComponent(location) {
this.location = location;
this.frameUrl = "/MoyaWeb/";
}
OldMoyaComponent.prototype.ngOnInit = function () {
};
OldMoyaComponent.prototype.logIt = function () {
console.log(this.frameUrl);
console.log(this.frametus.nativeElement.contentWindow.location.href);
console.log(location.path(true));
};
__decorate([
core_1.ViewChild('frametus')
], OldMoyaComponent.prototype, "frametus", void 0);
OldMoyaComponent = __decorate([
core_1.Component({
selector: 'app-old-moya',
providers: [common_1.Location, { provide: common_1.LocationStrategy, useClass: common_1.PathLocationStrategy }],
templateUrl: './old-moya.component.html',
styleUrls: ['./old-moya.component.css']
})
], OldMoyaComponent);
return OldMoyaComponent;
}());
exports.OldMoyaComponent = OldMoyaComponent;
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OldMoyaComponent } from './old-moya.component';
describe('OldMoyaComponent', () => {
let component: OldMoyaComponent;
let fixture: ComponentFixture<OldMoyaComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OldMoyaComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OldMoyaComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy} from "@angular/common";
@Component({
selector: 'app-old-moya',
providers: [Location, {provide: LocationStrategy, useClass: PathLocationStrategy}],
templateUrl: './old-moya.component.html',
styleUrls: ['./old-moya.component.css']
})
export class OldMoyaComponent implements OnInit {
frameUrl: String = "/MoyaWeb/";
@ViewChild('iframe') iframe: any;
height: string = "1000px";
constructor(private location: Location) {
let tmpUrl = this.location.path(true).split("#",2);
if(tmpUrl.length > 1) {
this.frameUrl = "/MoyaWeb/" + tmpUrl[1];
}
}
ngOnInit() {
}
changeUrl() {
let tmpUrl = this.iframe.nativeElement.contentWindow.location.href.split("/MoyaWeb/",2);
if(tmpUrl.length > 1) {
this.location.replaceState(this.location.path(false) + "#" + tmpUrl[1]);
}
this.height = this.iframe.nativeElement.contentWindow.document.body.scrollHeight + "px";
}
}
"use strict";
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 core_1 = require('@angular/core');
var SafePipe = (function () {
function SafePipe(sanitizer) {
this.sanitizer = sanitizer;
}
SafePipe.prototype.transform = function (url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
};
SafePipe = __decorate([
core_1.Pipe({
name: 'safe'
})
], SafePipe);
return SafePipe;
}());
exports.SafePipe = SafePipe;
"use strict";
describe('SafePipe', function () {
it('create an instance', function () {
});
});
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer} from '@angular/platform-browser';
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {}
transform(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
}
"use strict";
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 core_1 = require('@angular/core');
var TestComponent = (function () {
function TestComponent() {
this.counter = 0;
}
TestComponent.prototype.ngOnInit = function () {
};
TestComponent.prototype.addOne = function () {
this.counter++;
};
__decorate([
core_1.Input()
], TestComponent.prototype, "counter", void 0);
TestComponent = __decorate([
core_1.Component({
selector: 'app-test',
templateUrl: './test.component.html',
styleUrls: ['./test.component.css']
})
], TestComponent);
return TestComponent;
}());
exports.TestComponent = TestComponent;
"use strict";
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 core_1 = require('@angular/core');
var ViplistComponent = (function () {
function ViplistComponent(viplistService) {
this.viplistService = viplistService;
}
ViplistComponent.prototype.ngOnInit = function () {
this.vips = this.viplistService.get();
};
ViplistComponent = __decorate([
core_1.Component({
selector: 'moya-viplist',
templateUrl: './viplist.component.html',
styleUrls: ['./viplist.component.css']
})
], ViplistComponent);
return ViplistComponent;
}());
exports.ViplistComponent = ViplistComponent;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!