angular


Cannot read property 'contactDetails' of undefined?


I have this contactdetail model where i have this:
export class Contact{
public displayname:string;
constructor(){}
}
In my component contactdetail.component.ts i have this:
export class ContactDetail implements OnInit {
contactDetails: Contact = new Contact();
constructor() { }
ngOnInit() { }
}
In my contactdetail.template.html i have this:
<input type="text" class="form-control-full" placeholder="-" [(ngModel)]="contactDetails.displayname" [ngModelOptions]="{standalone: true}">
Now i have another component preview where i have this:
#ViewChild( ContactDetail ) contactDetailForm: ContactDetail;
But i do this i get an error:
this.contactDetailForm.contactDetails.displayname = contact.displayname;
Any suggestion why is that?
This is where im using contactdetail component:
<z-card-basic title="Details" *ngIf="showSubTab('Contact')" (pinButtonClicked)="pinTab($event)" [buttons]="customTabButtons" block="block-tab-grid" header="block-header-grey" body="no-padding" >
<contact-detail></contact-detail>
</z-card-basic>

Related Links

Angular4 aot debug
When bundling using systemjs-builder. At runtime i get an unable to get property 'prototype' of undefined or null reference
Issues with ng2-charts
Cordova media plugin is not working in marshmallow
Is Angular2 responsive out of the box?
Async call update HTML Element though Angular 4.x Service
Uncaught ReferenceError: define is not defined angular2/webpack 1
unable to find suitable angular data grid for angular 2.4.1 version?
Access process.env in environment.ts file created from the angular-cli
Cannot read property 'channels' of undefined youtube api
How to set the public path on angular 4
Using local Bootstrap3 with angular 2
Firebase: update database when no write operation happens in 5 minutes interval
Build single directive to perform both Structural & Attribute behaviour?
Angular 2 Sending data to child
AOT - Function calls are not supported Module.forRoot

Categories

HOME
node.js
linux-kernel
google-maps
perl
loadrunner
https
imageview
reactor-netty
mapkit
strongswan
xhtml
gemfire
ninja
postgresql-9.0
spring-statemachine
zillow
serenity-bdd
google-app-invites
unimrcp
premailer
google-developers-console
filepicker.io
structured-data
interceptor
nodemon
na
neo4jclient
bluehost
pi
pivottable.js
sap-bw
bspline
devexpress-wpf
model-driven
singleton-type
reduce
xc8
allegro5
measurement-studio
gear-vr
oltp
c++1z
shodan
android-gson
istanbul
bubble-sort
nslog
hashset
news-feed
pubsubhubbub
deferred-loading
servant
couchbase-sync-gateway
bitcount
jlist
android-context
ssas-2008
typescript1.7
amdatu
soundex
event-loop
microsoft.mshtml
orchardcms-1.6
resin
sapb1
rot13
workbench
accessdatasource
data-sharing
wxgrid
chaplinjs
buttonclick
styledtext
resourcedictionary
sencha-touch-2.2
where-in
angularjs-e2e
struts2-tiles-plugin
websitespark
cvxopt
imagecreatefrompng
django-sessions
.lrc
system-design
xemacs
mbprogresshud
scopes
in-app
wind-river-workbench
rails-models
iphone-3gs
xmlnodelist
entityreference
showmodaldialog
duck-typing
platform-independence

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App