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?