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

Update an array with new objects
Dropbox service with popup
Sending Emails Using TinyMce- Angular 2
Nested form tags in angular 2
Toggle Value in Angular Material CheckBox
Angular2 cli error cannot resolve #angular animations from primeng2 components
ionic2 AlertController, how to return the buttons clicked value from method
Cannot read property 'stateChangeExpr' of null at _parseAnimationStateTransition
Angular2 : not able to install xml2json
Ionic 3 - Supplied parameters do not match any signature of call target
Angular2/Rxjs HTTP Catch Asynchronous Transform Issue
Angular2 get if router has canActivate()
Kendo Angular2 npm from build server?
Angular2 material npm dependencies
typescript “:” expected in ionic 2 app
Hit Error: $injector:unpr Unknown Provider when use a custom service in my own module before angular bootstrap

Categories

HOME
arduino
highcharts
jsoup
sendmail
javafx-2
android-gradle
strongswan
iis-8
formula
osticket
translate
interaction
mit-scratch
google-play-games
atlassian-sourcetree
biopython
skybot
azure-storage-blobs
gun
xfce
geckofx
graphic
ecore
lsmeans
dexguard
spamassassin
angularjs-ng-model
initializing
meta-tags
sencha-architect
khan-academy
falcor
o365rwsclient
angular-chart
family-tree
behavior
tinyxml2
webpack-style-loader
sift
munin
spring-java-config
svg-edit
android-image
post-commit
mailman
nested-forms
lzma
reducers
gethostbyname
arrangeoverride
struts2-jquery-grid
couchbase-sync-gateway
divider
mod-jk
adobe-dps
tstringgrid
glut
protection
setlocale
html5-validation
custom-validators
event-loop
interspire-shopping-cart
resin
xcode-organizer
wpftoolkit
uploadifive
filefield
dav
webproxy
n-tier
sandbox-solution
mindmap
divshot
meteor-slides
tandem
mathtype
server-side-scripting
enctype
springmockito
ext-direct
webarchive
single-user
cocos2d-python
multiple-versions
blogml
incremental-linking
o3d

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile