Angular +绑定到导航属性

时间:2015-01-26 14:14:01

标签: angularjs breeze angular-ngmodel

我的服务器端代码

 public class Person
{
    public int PersonId { get; set; }
    public string FirstName { get; set; }
}

public class Employee
{
    public int EmployeeId { get; set; }
    public string EmployeePhoto { get; set; }
    public virtual Person Person { get; set; }

    [ForeignKey("Person")]
    public virtual int PersonId { get; set; } // relates Employee to Person
}

我在clinet上使用breeze进行dataservice

var employee = manager.createEntity('Employee');
var person = manager.createEntity('Person');
employee.person = person;

我绑定到我的viewModel(像这样的角度控制器属性)

vm.employee = employee 

我试图像这样访问html

<input ng-model="vm.employee.person.firstName" placeholder="First Name" id="firstName" />

但它没有锻炼...

帮助Plz

0 个答案:

没有答案