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

Angular 2. Doubled custom tags
Integration Stripe Elements with angular 2
How to format phone number while typing in angular 2?
Angular: Wrap providers in a module?
Angular - getting the handle to the ng-content component in the parent
How to use ng.material.MdDialog in ES5?
Access to a variable through all the components Angular2
Trouble with Microsoft Edge, Protractor and Jasmine
Error: XHR error (404 Not Found) in Angular2 application
do I have to create custom value accessors to use buttons as form controls in angular 2?
Angular 2 datatable with keyboard support
Karma can't find my tests in my angular-cli app
How to add cordova contact module in ionic 3 app.js
How do I send local notifcation in Ionic 3?
Angular 2 => no provider for {ClassName}
How to open a tab and load its contents as soon as its created?

Categories

HOME
audio
powershell-v4.0
masonry
junit
payment
get
mariadb
tensorboard
angularjs-ng-transclude
business-objects
video.js
emu8086
beatbox
eventtrigger
divide-and-conquer
bootstrap-select
jquery-animate
premailer
apache-samza
ssis-2008
jsdata
entity-relationship
eof
sandbox
http-caching
interceptor
nodemon
modeling
inorder
jung
hashcode
polymer-serve
audiokit
data-storage
binary-image
roc
pywinusb
modelio
smo
run-configuration
docker-registry
android-gson
embedded-javascript
leshan
orphan
raptor
apple-watch-complication
ratchet
testdroid
pragma
scrapyd
stunnel
mindbody
assignment-operator
jseparator
pysqlite
singularitygs
xcode-bots
sql-agent-job
aloha-editor
elasticsearch-marvel
uiactivity
cloudcontrol
rich-snippets
ttml
cakedc
pixate
restriction
mathgl
string-conversion
rails-i18n
resourcedictionary
pivotitem
android-3.0-honeycomb
apprequests
cvxopt
panning
operational-transform
gwt-2.5
sts-securitytokenservice
glossary
function-overloading
wind-river-workbench
continuations
rebuild
oracle8i

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile