Nativescript angularjs 2.0 data binding
<p>Using nativescript 2/angular 2, having problems with data binding. I'm familiar with angularJS 1.x, but the docs I've read on this, this should be working. Tried different variations of ngModel, but not working. The value of record.name is "undefined".</p>

<p>The record class simply has an id and name field defined. My other question is how do you trigger a change event to the component? If a user is starting to type in a text input, how can I call a function in the component as they are typing?</p>

<p>Below is my "html":</p>

<pre><code>&lt;StackLayout&gt;   
    &lt;Textfield hint="Search for a Record" [(ngModel)]="record.name" (returnPress)="searchRecord()"&gt;&lt;/Textfield&gt;
    &lt;Label text="{{ record.name }}"&gt;&lt;/Label&gt;
    &lt;Button text="Search" class="btn" (tap)="searchRecord()"&gt;&lt;/Button&gt;

    &lt;Button text="Take Photo" class="btn" (tap)="takePhoto()"&gt;&lt;/Button&gt;
&lt;/StackLayout&gt;
</code></pre>

<p>Add record component:</p>

<pre><code>import {Component} from "@angular/core";

import cameraModule = require("camera");
import imageModule = require("ui/image");

import {Record} from "../../shared/record/record";
import {RecordService} from "../../shared/record/record-service";

@Component({
  selector: "add-record",
  templateUrl: "pages/add-record/add-record.html",
  styleUrls: ["pages/add-record/add-record-common.css"],
  providers: [ RecordService ]
})
export class AddRecordPage {    
    record: Record;

    constructor(private _recordService: RecordService) {
        this.record = new Record();
    }

    searchRecord() {
        console.log(this.record.name + '!');


        this._recordService.add(this.record)
            .subscribe(
                () =&gt; {
                    alert('a');
                },
                () =&gt; {
                    alert('b');
                }
            );
    }

    takePhoto() {
        cameraModule.takePicture().then(picture =&gt; {
            console.log("Result is an image source instance");
            var image = new imageModule.Image();
            image.imageSource = picture;

        });
    }
}
</code></pre>

<p>Thanks!</p>