如何在Angular 2中处理ForeignKey

时间:2016-12-16 15:55:33

标签: angular

我是角色2的新手。我想消耗使用外键的REST API。 类别= [     {         " id":1,         "书籍":[             1,             2         ] }, {         " id":2,         "书籍":[             4,             7         ] } ]

书籍= [

{
    "id": 1,
    "category": 1,
    "title": "Book1",
 },
{
    "id": 2,
    "category": 1,
    "title": "Book2",
},
{
    "id": 4,
"category": 2,
   "title": "Book4",

},

{         " id":7,         "类别":2,        " title":" Book4",

}

我该怎么做category.id == book.category?

0 个答案:

没有答案