English 中文(简体)
无法约束的肾脏
原标题:knockoutjs unable to parse bindings

我正从knockoutjs处带走以下错误。 它清楚地知道,“地区”是大部分时间,因为“土地倡议”表明“地区”正在显示,但有时会以错误冻结。

Uncaught Error: Unable to parse bindings. 
Message: TypeError: Object #<Object> has no method  AreaNames ; 
Bindings value: foreach: ActiveDay().AreaNames()

相关守则:

<ul data-bind="foreach: ActiveDay().AreaNames()">
    <li data-bind="text: $data"></li>
</ul>

var scheduleModel = function (shiftCellToggle) {
    var vm = this;
    vm.ActiveDay = ko.observable({ AvailableShiftCategories: [] });
    vm.CustomMapping = {
         Weeks : {
            create: function (options) {
                var week = new scheduleWeekModel(vm, shiftCellToggle);
                ko.mapping.fromJS(options.data, week.CustomMapping, week);
                return week;
            }
        }
    };
}

    var scheduleWeekModel = function (scheduleModel, shiftCellToggle) {
        var vm = this;
        vm.CustomMapping = {
             Days : {
                create: function (options) {
                    var day = new scheduleDayModel(scheduleModel, shiftCellToggle);
                    ko.mapping.fromJS(options.data, day.CustomMapping, day);
                    return day;
                }
            }
        };
    var scheduleDayModel = function (scheduleModel, shiftCellToggle) {
        var vm = this;
        vm.CustomMapping = {
             AvailableShiftCategories : {
                create: function (options) {
                    var availableShiftCategory = new availableShiftCategoryModel(scheduleModel, vm, shiftCellToggle);
                    ko.mapping.fromJS(options.data, availableShiftCategory.CustomMapping, availableShiftCategory);
                    return availableShiftCategory;
                }
            }
        };

        vm.AreaNames = ko.observableArray([]);

var viewModel = new scheduleModel(createShiftToggle());
ko.applyBindings(viewModel);
问题回答

页: 1 但你具有约束力的意思是,<代码>AreaNames是物体代码的一部分。 这从你提供的法典中看不出。 我们需要看到更多的法典。

什么? 该物体是否通过<条码> 适用?

我的第一项想法是,假设<代码>ActiveDay是贵方根证书上的一项财产,在某个时候,该财产是未经签字的,以你描述的方式打破约束。

希望这一帮助。





相关问题
How to go from DOM node to viewModel object?

When the drop function is called back, this is set to the droppable DOM node (the target) and ui.draggable is the DOM node which was dragged. Is there an idiomatic way of getting the model object ...

making fields observable after ajax retrieval in knockout.js

I am wondering how I can make certain fields observables in knockout.js that I get from an ajax call without having to define the whole object in my viewmodel. Is this possible? Here is what I have ...

ASP.NET MVC Validation with jQuery $.ajax

I have a situation where I am sending data to a Controller via jQuery $.ajax, the data is a serialized json string. (MVC 3.0) It binds it fine - my controller receives the results and they are ...

Knockout.js and MVC

Just started playing with knockout.Js which is a fantastic framework Steve s really done well with that one. One thing I can t seem to do at the minute is impliment it with my Html Helpers. So for ...

Anyone using Knockoutjs with asp.net-mvc in anger? [closed]

I find it very interesting and have a prototype working based on Steve s mvc sample and another small sample from this thread. Using json.net to deserialize within the post action as I couldn t ...

热门标签