import { Component, OnInit, ElementRef } from '@angular/core';
import { CfCoreComponent } from '../core/core.component';
import { CfCoreBusinessComponent } from '../core-business/core-business.component';
import { CfButtonComponent } from '../button/button.component';
import { CfNewsComponent } from '../news/news.component';
import { CfWorldClockComponent } from '../world-clock/world-clock.component';
import { ClockComponentModel } from '../../models/clock/clock-component.model';
import { PageService } from '../../services/page-service/page.service';
/**
* This component refers to a Weather app.
*/
@Component({
selector: 'cf-app-page',
template: "
",
styles: [".cf-page-content-styles { background: grey URL(\"/assets/images/page_background.jpg\") no-repeat 0 0; background-size: 100% 100%; position: fixed; left: 0; top: 0; bottom: 0; right: 0; } .cf-page-content { left: 0; top: 75px; bottom: 75px; right: 0; position: absolute; } .cf-page-header { background: #03A9F4; color: #fff; position: fixed; left: 0; right: 0; top: 0; min-height: 50px; } .cf-page-header img { width: 113px; height: 34px; } .cf-page-footer { background: #03A9F4; color: #fff; position: fixed; left: 0; right: 0; bottom: 0; min-height: 50px; } .cf-page-footer span { padding-top: 14px; padding-left: 20px; padding-bottom: 15px; } .cf-page-header .cf-page-header-spacer { flex: 1 1 auto; } .cf-page-header a { color: #ffffff; } .buttonTreeBar { margin-right: 30px; background: #1E90FF; } .buttonSendMessage { background: #1E90FF; } .buttonAddComp { background: #1E90FF; } .buttonRemoveComp { background: #1E90FF; } .cf-page-cell { border: 1px dashed; background: lightblue; } "]
})
export class CfAppPageComponent extends CfCoreBusinessComponent implements OnInit {
clock : ClockComponentModel = {
id: "Clock1",
city: "Paris"
};
constructor(public elementRef: ElementRef, public pageService: PageService) {
super(elementRef);
this.id = 'app-page';// have to set explicitly to get components form the storage
}
/**
* This method is called when initializing the component.
*/
ngOnInit() {
super.ngOnInit();
this.pageService.loadComponents(this.id, []);
}
}
/*
SCENARIO:
- Create page with header and footer. In header, menu Page1, Page2, Page3 - switch between pages with animation.
- Page has 2 columns.
- Create 3 pages that contains different components. Component takes the whole size of the page.
- Click on component one that will make react another component in another page in second column.
- There should be app context for that.
- App and pages are static HTML. No dragging/dropping. It's a portal like pages.
*/