Commit 3fc6f7a5 authored by prumde's avatar prumde

Updated changes in app.component.ts and app.module.ts .

Added new service host-url.service.ts .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174510 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8698273c
...@@ -4,6 +4,7 @@ import {Location, LocationStrategy, PathLocationStrategy} from '@angular/common' ...@@ -4,6 +4,7 @@ import {Location, LocationStrategy, PathLocationStrategy} from '@angular/common'
import {AppState} from './ecm-store/reducers'; import {AppState} from './ecm-store/reducers';
import {CartActions, CategoryActions, MenuActions, WishListActions} from './ecm-store/actions'; import {CartActions, CategoryActions, MenuActions, WishListActions} from './ecm-store/actions';
import { HostUrlService } from './host-url.service';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
@Component({ @Component({
selector: 'ecm-root', selector: 'ecm-root',
...@@ -14,10 +15,17 @@ import { Store } from '@ngrx/store'; ...@@ -14,10 +15,17 @@ import { Store } from '@ngrx/store';
export class AppComponent { export class AppComponent {
title = 'Proteus ECM'; title = 'Proteus ECM';
location: Location; location: Location;
constructor(location: Location, private store: Store<AppState>, private cartAction: CartActions, private categoryAction: CategoryActions, private menuAction:MenuActions, private wishListAction: WishListActions) { constructor(location: Location, private store: Store<AppState>, private cartAction: CartActions, private categoryAction: CategoryActions, private menuAction:MenuActions, private wishListAction: WishListActions, public hostUrlService : HostUrlService) {
this.location = location; this.location = location;
console.log( ' this.location.path(true)[' + this.location.path(true) + ']'); console.log( ' this.location.path(true)[' + this.location.path(true) + ']');
this.checkAppState(); var url = '';
if( document.getElementById("hostUrl") ){
url= (<HTMLInputElement>document.getElementById("hostUrl")).value;
}
this.hostUrlService.hostUrl = url;
setTimeout(() => {
this.checkAppState();
}, 1000);
} }
checkAppState(){ checkAppState(){
this.setItem('jwtToken', this.get('jwtToken'), false ); this.setItem('jwtToken', this.get('jwtToken'), false );
......
...@@ -66,7 +66,7 @@ import { EcmProductService } from './ecm-view/ecm-product/ecm-product.service'; ...@@ -66,7 +66,7 @@ import { EcmProductService } from './ecm-view/ecm-product/ecm-product.service';
import { EcmProductDetailService } from './ecm-product-details/ecm-product-detail.service'; import { EcmProductDetailService } from './ecm-product-details/ecm-product-detail.service';
import { EcmLocationService } from './ecm-search/ecm-location.service'; import { EcmLocationService } from './ecm-search/ecm-location.service';
import { Breadcrumbs } from './ecm-breadcrumbs/ecm-breadcrumbs.component'; import { Breadcrumbs } from './ecm-breadcrumbs/ecm-breadcrumbs.component';
import { HostUrlService } from './host-url.service';
import reducer from './ecm-store/reducers'; import reducer from './ecm-store/reducers';
import {CartActions, CategoryActions, SubCategoryActions, ItemActions, LocationActions, WishListActions, MenuActions,ProfileActions, AdressAction, ReviewAction, SavedCardAction} from './ecm-store/actions'; import {CartActions, CategoryActions, SubCategoryActions, ItemActions, LocationActions, WishListActions, MenuActions,ProfileActions, AdressAction, ReviewAction, SavedCardAction} from './ecm-store/actions';
import {CartEffects, CategoryEffects, SubCategoryEffects, ItemEffects, WishlistEffects, MenuEffects,ProfileEffects, AddressEffects, ReviewsEffects, SavedCardEffects} from './ecm-store/effects'; import {CartEffects, CategoryEffects, SubCategoryEffects, ItemEffects, WishlistEffects, MenuEffects,ProfileEffects, AddressEffects, ReviewsEffects, SavedCardEffects} from './ecm-store/effects';
...@@ -208,6 +208,7 @@ const appRoutes: Routes = [ ...@@ -208,6 +208,7 @@ const appRoutes: Routes = [
EcmProductDetailService, EcmProductDetailService,
LocationActions, LocationActions,
EcmLocationService, EcmLocationService,
HostUrlService,
WishListActions, WishListActions,
MenuActions, MenuActions,
ProfileActions, ProfileActions,
......
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class HostUrlService {
constructor( ) {}
url: string;
get hostUrl(): any {
console.log('hostUrl:['+this.url+']');
return this.url;
}
set hostUrl(hostUrl) {
// let url= (<HTMLInputElement>document.getElementById("hostUrl")).value;
console.log('value of hostUrl in set this.HOSTurl',hostUrl);
this.url = hostUrl;
console.log('value of hostUrl in set this.url',this.url);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment