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

Changing Server port on Angular 2
Angular 2 typescript compilation error :A class declaration without the 'default' modifier must have a name
Angular 2: Select dropdown not selecting option despite “selected” attribute
angular2 singleton alternative
Angular2 terrible performance with ngFor assigning variable to “index”
nav.popToRoot() showing blank screen
Anguler2 js: getting no compatible version found : #types/node#^5.8.0
Angular 2 xi18n cannot resolve template path outside of component directory
Angular 2 - Uncaught (in promise): ReferenceError: System is not defined
update routes dynamically in angular2 app
Resolving Multiple Pieces of Data using Resolve Guard in Angular 2
Angular 2 disable form button from ts?
ng2-charts - Can't bind to 'datasets' since it isn't a known property of 'base-chart'
Angular 2 not showing correctly values in input
Webpack resolve.modulesDirectories doesn't seem to work
Text editors in angular2

Categories

HOME
react-native
highcharts
google-maps-api-3
rx-java
multidimensional-array
statistics
authorization
node-red
post
ais
geogebra
formula
url-rewriting
windows-authentication
sourceforge
m3u8
category
denial-of-service
prefix
ietf-netmod-yang
sprite
react-apollo
pfsense
revit
ractivejs
z80
hal
polymer-starter-kit
lwip
aspose-cells
layer
uwamp
crawler4j
thinktecture-ident-model
angularjs-ng-model
web.py
james
uisearchbar
moa
c#-6.0
automated-deployment
fluent-nhibernate
gulp-usemin
bandwidth
orika
proof-of-correctness
wso2-appm
lab-color-space
zoo
magicalrecord
sqlcommand
use-case
launch-agent
svg-edit
metamodel
spock-reports
swig-template
spoon
correspondence-analysis
throttle
simplify
ibm-jazz
datamapper
episerver-6-r2
gridsplitter
busy-waiting
fody-propertychanged
nstablecolumn
pysftp
childviewcontroller
gamma-function
wave
drilldown
safari9
html5-validation
voog
compiler-options
resin
worksite-sdk
dcraw
uploadifive
vtune
ember-testing
curator
javascript-databinding
form-helpers
triples
graphael
styledtext
presentmodalviewcontrolle
facebook-app-center
emacs-semantic
divshot
android.mk
remotipart
readelf
icarousel
static-array
contentflow
plcrashreporter
scalaquery
google-doodle
looper
rakefile
stack-unwinding
id-generation
windows-2000
maintenance-plan
reverse-debugging
comdlg32
zero-pad

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