Skip to content

Commit

Permalink
fix(chips): Fix adding new chips on demo page (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
dozingcat authored and tinayuangao committed Mar 10, 2017
1 parent f02af52 commit 2d16a24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/demo-app/chips/chips-demo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, ElementRef} from '@angular/core';
import {Component} from '@angular/core';

export interface Person {
name: string;
Expand Down Expand Up @@ -39,10 +39,10 @@ export class ChipsDemo {
alert(message);
}

add(input: ElementRef): void {
if (input.nativeElement.value && input.nativeElement.value.trim() != '') {
this.people.push({ name: input.nativeElement.value.trim() });
input.nativeElement.value = '';
add(input: HTMLInputElement): void {
if (input.value && input.value.trim() != '') {
this.people.push({ name: input.value.trim() });
input.value = '';
}
}

Expand Down

0 comments on commit 2d16a24

Please sign in to comment.