Example #1
0
 onClick(event) //TODO: build for various sub-stages with a stack
 {
     if (this.isHome == true) {
         this.router.navigateByUrl('/Configuration');
         this.buttonText = '< Back'; // maybe make a sort of arrow here, like "<- Back" ?
         this.isHome = false;
     }
     else {
         this.openhabAdapterServiceHome.getPage(DataContainer.ActivePageUrl, (page) => { this.setPage(page) }, "error");
         this.buttonText = 'Configuration';
         this.isHome = true;
     }
 }
Example #2
0
 //itemList: Array<item>;
 constructor(openhabAdapterServiceHome: openhabAdapterService) {        // <- is not called! probably need an on page load function to call getPage
     console.log('home constructor called');
     this.setPage(new page(null));         
     //this.Page = DataContainer.Page;
     //console.log('page.title: ' + this.Page.title);   
     //var openhabAdapterServiceHome: openhabAdapterService;
     //openhabAdapterServiceHome = new openhabAdapterService();
     console.log('ACTIVEPAGEURL: ' + DataContainer.ActivePageUrl + ' ------------------------------------');
     openhabAdapterServiceHome.getPage(DataContainer.ActivePageUrl, (page) => { this.setPage(page) }, "error"); // TODO: set propper errorCallBack
     // TODO: Call openhabAdpterService getPage on current URL
     // how to read out current URL? need to connect this to navigation? or rather to the stack?
     // probably read current top from stack to get URL, maybe make a stack of objects that contain a URL? or just stack of URLs
     // then page contains all data needed to display something
 }