Skip to content

Commit

Permalink
fix(core): fixing HostBinding
Browse files Browse the repository at this point in the history
Consider preferring the @HostListener and @HostBinding to the host property of the @directive and
@component decorators.
  • Loading branch information
andreasonny83 committed May 28, 2017
1 parent da0575d commit ce84bcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/app/board-page/board-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, HostBinding } from '@angular/core';
import { Location } from '@angular/common';
import { ActivatedRoute, Params } from '@angular/router';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
Expand Down Expand Up @@ -32,9 +32,10 @@ interface IBoardObj {
templateUrl: './board-page.component.html',
styleUrls: ['./board-page.component.scss'],
animations: [slideToLeft],
host: {'[@routerTransition]': ''},
})
export class BoardPageComponent implements OnInit {
@HostBinding('@routerTransition') routerTransition = '';

public boardID: string;
public boardName: string;
public board: FirebaseListObservable<any[]>;
Expand Down
5 changes: 3 additions & 2 deletions src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, HostBinding } from '@angular/core';
import { FormGroup, FormControl, FormBuilder, Validators, AbstractControl } from '@angular/forms';
import { slideToLeft } from '../app.animations';
import { FirebaseService } from '../../firebase';
Expand All @@ -11,9 +11,10 @@ import { Observable } from 'rxjs/Observable';
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css'],
animations: [ slideToLeft ],
host: {'[@routerTransition]': ''},
})
export class DashboardComponent implements OnInit {
@HostBinding('@routerTransition') routerTransition = '';

public boards: Observable<any>;
public user: Observable<any>;
public newBoardForm: FormGroup;
Expand Down
5 changes: 3 additions & 2 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, HostBinding } from '@angular/core';
import {
FormGroup,
FormControl,
Expand All @@ -17,9 +17,10 @@ import { DialogResetEmailComponent } from './dialog-reset-email';
templateUrl: './login.component.html',
styleUrls: ['./login.component.css'],
animations: [slideToLeft],
host: {'[@routerTransition]': ''},
})
export class LoginComponent implements OnInit {
@HostBinding('@routerTransition') routerTransition = '';

public loginForm: FormGroup;
public registerForm: FormGroup;
public loginLoading: boolean;
Expand Down

0 comments on commit ce84bcb

Please sign in to comment.