0
我想將此列表添加到我的視圖模型中,以便使某些綁定更簡單一些。但是,我無法弄清楚爲什麼要這樣做。將對象列表添加到ViewModel中
var images = [
{ name: "Image 1", photo: "/images/image1.jpg" },
{ name: "Image 2", photo: "/images/image2.jpg" },
{ name: "Image 3", photo: "/images/image3.jpg" },
];
var viewModel = {
favorite: "",
...
}
如果你需要知道如何訪問它在數據雙贏的結合觀看[問題](http://stackoverflow.com/questions/15089191/how-to-show-data-from-array-in-windows-8-app) –