summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/app.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2019-08-28 15:17:26 +0800
committercyuamber <xuranyjy@chinamobile.com>2019-08-29 10:42:11 +0800
commitcbb4b91ad39b44a76d1b1d4b745ef2b38fab74ce (patch)
tree9d8727beb61c856d776ca7aa0d94e325a98cc0ab /usecaseui-portal/src/app/app.component.ts
parentad9cae16291c6e1693af80f2360187d220e58f69 (diff)
bug: menu bar bug fixed
Change-Id: I84dd884d6dbcd2831be238629eb5e0ba8ef8d1cc Issue-ID: USECASEUI-307 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/app.component.ts')
-rw-r--r--usecaseui-portal/src/app/app.component.ts74
1 files changed, 20 insertions, 54 deletions
diff --git a/usecaseui-portal/src/app/app.component.ts b/usecaseui-portal/src/app/app.component.ts
index d654900c..7306db1c 100644
--- a/usecaseui-portal/src/app/app.component.ts
+++ b/usecaseui-portal/src/app/app.component.ts
@@ -17,7 +17,8 @@ import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {MyhttpService} from "./core/services/myhttp.service";
import {HomesService} from "./core/services/homes.service";
-
+import {NavigationEnd, Router} from '@angular/router';
+import 'rxjs/add/operator/map';
@Component({
selector: 'app-root',
@@ -25,10 +26,20 @@ import {HomesService} from "./core/services/homes.service";
styleUrls: ['./app.component.less']
})
export class AppComponent {
+ public url:string = 'home';
- constructor(private translate: TranslateService,private myhttp: HomesService) {
+ constructor(private translate: TranslateService,private myhttp: HomesService,private router:Router,) {
this.currentLanguageGet();
- // translate.use('en');
+ this.getUrl();
+
+
+ }
+ getUrl(){
+ this.router.events.map(event=> {
+ if(event instanceof NavigationEnd){
+ this.url = event['url'].slice(1)
+ }
+ }).subscribe(event=>{})
}
@@ -57,57 +68,12 @@ export class AppComponent {
sessionStorage.setItem("DefaultLang",this.currentLanguage);
}
}
- activeMenuBar =[true,false,false,false,false];
- activeMenuList =[false,false];
- thisActive(item){
- if(this.activeMenuBar[item] == true){
- this.activeMenuBar.map((its,index) => {
- if(item != index){
- this.activeMenuBar[index] = false;
- }
- })
- }else {
- this.activeMenuBar.map((its,index) => {
- if(item == index){
- this.activeMenuBar[item] = true;
- }else {
- this.activeMenuBar[index] = false;
- }
- })
- this.activeMenuList.map((its,index) => {
- this.activeMenuList[index] = false;
- })
+ get flag () {
+ if(!this.url.indexOf('services')){
+ return true
+ }else{
+ return false
}
}
- thisListActive(item){
- if(this.activeMenuBar[3] = true){
- if(this.activeMenuList[item] == true){
- this.activeMenuList.map((its,index) => {
- if(item != index){
- this.activeMenuList[index] = false;
- }
- })
- }else {
- this.activeMenuList.map((its,index) => {
- if(item == index){
- this.activeMenuList[item] = true;
- }else {
- this.activeMenuList[index] = false;
- }
- })
-
- }
- }else {
- this.activeMenuList.map((its,index) => {
- this.activeMenuList[index] = false;
- })
- }
- }
- //
- // selectLanguage = "en";
-
- // changeLanguage(item){
- // this.selectLanguage = item;
- // this.translate.use(item);
- // }
+
}