define(['plugins/http', 'durandal/app', 'knockout'], function (http, app, ko) {
return {
displayName: 'Flickr',
Value: ko.observableArray([]),
js : $.getJSON("http://localhost:XXXXX/api/File/Get", function (result) {
self = this;
self.Value = result;
console.log(JSON.stringify(self.Value));
//[{"ID":1,"Name":"a","Type":"text","Size":123},{"ID":1,"Name":"a","Type":"text","Size":123},{"ID":1,"Name":"a","Type":"text","Size":123}]
}),
我在我的 Drundal SPA 应用程序(flick.js)中有上面的代码,我的(flick.html)有下面的代码
<ul class="thumbnails" data-bind="foreach: Value">
<li data-bind=" text: Name ">
</li>
</ul>
但是当我执行此代码时,我没有在我的 html 文件中获取名称列表
出了什么问题任何人都可以帮助我