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

Getting all routes from current module - Angular 2
Ionic 2 Cache issue with tabs application
Set selected option by default on angular template
Downloading Redux State into an Angular 2 component and then iterating over its result
How to push on FormArray without FormBuilder on Angular 2
Angular 2, Uncaught Type Error: Cannot read property 'Injectable' of undefined
Set width to an Angular2-modal window
identityserver4 angular client, from where come the call to this endpoint
Angular2 translation after subscribing to service
Kendo UI - Texfield not showing in MultiSelect when Value is 0
InvalidPipeArgument for pipe 'DatePipe'
Native Element in angular 2
Module Communication between Product Module and User Module
How do I use login session in angular2 (local storage) with php backend
Angular : Array.splice in an ngFor with a pipe
AngularFire2 4.0.0: Login with Email & Password

Categories

HOME
okta
lucene
set
winzip
keen-io
powerbuilder
uwp-xaml
import
reactor-netty
ssd
asp.net-web-api2
strongswan
uinavigationcontroller
jlabel
sdl
couchbase-view
sqlanywhere
multiline
probability-theory
cider
touch
coap
btrfs
http-caching
vowpalwabbit
ext4
fxml
radius
android-ffmpeg
required
sharethis
asn.1
crossfilter
leanft
war
powerdns
sqlcmd
data-compression
actor
azure-sql-server
mlt
android-optionsmenu
gold-parser
yield
ctags
run-configuration
wamp-protocol
proof-of-correctness
coupling
on-screen-keyboard
siteminder
outlook-2016
mapfragment
oslo
data-connections
ng-template
r1soft
idiorm
backspace
distinct-on
gamma-function
soundex
rich-snippets
jxa
mashape
kiosk-mode
jml
member
factoring
facebook-app-center
sencha-touch-2.2
graphml
cvxopt
panning
ereg
backbone-forms
readelf
wexitstatus
timezoneoffset
addr2line
snk
fibonacci-heap
alasset
microsoft.build
isaserver
o3d

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile