refactor(router): code style changes

This commit is contained in:
nixa 2016-07-07 16:30:00 +03:00
parent f24546639c
commit 24de0070fa
15 changed files with 80 additions and 59 deletions

View file

@ -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',

View file

@ -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;
}
}