Cannot get input element value ngFor

Hi all,

I am beginner in angular 2

I develop web chat app using angular 2.Pls refer this

I need dont display repeated value.Because I will check two variable.

below my html code

{{ | amDateFormat:'LL'}}

{{chat.path_text}} {{ | amDateFormat:'hh:mmA'}}
{{chat.message_text}} {{ | amDateFormat:'hh:mmA'}}

So i Bind the value using input tag.i get input element value using id.below my typescript file.

import { Component, Inject, ViewChild, ElementRef, AfterViewInit } from ‘@angular/core’;

export class ChatPage implements AfterViewInit {
@ViewChild(‘myname’) input: ElementRef;
constructor(public modalCtrl: ModalController, public navCtrl: NavController) { }
ngAfterViewInit() {

i am getting this error

Cannot read property ‘nativeElement’ of undefined

How to fix this issue.or any other way to find slutions.I need same values are does not show.

.I tried to many way.I have no idea.

Kindly Advice me,
Thanks & Regards