mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-11 03:58:50 +01:00
refactor(router): code style changes
This commit is contained in:
parent
f24546639c
commit
24de0070fa
15 changed files with 80 additions and 59 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import {Component, ElementRef, HostListener, ViewEncapsulation} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {AppState} from "../../../app.state";
|
||||
import {layoutSizes} from "../../../theme";
|
||||
import {BaSlimScroll} from "../../../theme/directives";
|
||||
import {BaSidebarService} from "./baSidebar.service";
|
||||
import {Component, ElementRef, HostListener, ViewEncapsulation} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {AppState} from '../../../app.state';
|
||||
import {layoutSizes} from '../../../theme';
|
||||
import {BaSlimScroll} from '../../../theme/directives';
|
||||
import {BaSidebarService} from './baSidebar.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ba-sidebar',
|
||||
|
|
|
|||
|
|
@ -45,21 +45,18 @@ export class BaSidebarService {
|
|||
}
|
||||
|
||||
private _isCurrent(route:UrlTree):boolean {
|
||||
if (!route)
|
||||
return false;
|
||||
|
||||
return this._router.url === this._router.serializeUrl(route);
|
||||
if (route) {
|
||||
return this._router.url === this._router.serializeUrl(route);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private _generateRoute(instructions:any[]):UrlTree {
|
||||
if (!instructions)
|
||||
return null;
|
||||
|
||||
instructions = instructions.filter(item => !!item);
|
||||
|
||||
if (instructions.length === 0)
|
||||
return null;
|
||||
|
||||
return this._router.createUrlTree(instructions);
|
||||
if (instructions.length != 0) {
|
||||
return this._router.createUrlTree(instructions);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue