清单模型不适用于angularJS

时间:2015-10-05 17:35:06

标签: javascript html .net angularjs checklist-model

我的代码强制检查表模型存在问题。 我的复选框没有填写我的模型

标记

<label>Service Lead *</label>
<div class="dropdown">
    <button title="This is a required field" ng-style="{'border-color': Style.Color}" class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="width:65%">
           {{SLDefaultText}}
            <span class="caret"></span>
    </button>
    <ul class="dropdown-menu">
        <li ng-click="SetSLText(sl)" ng-repeat="sl in ServiceLeads">
            <a href="#"><input type="checkbox" checklist-model="newProject.listOfSL" checklist-value="sl" />{{sl.FullName}}</a>
         </li>
     </ul>
 </div>

代码

$scope.newProject = { ProjectId: 0, ProjectName: '', ProjectDescription: '' };

  $scope.init = function () {
    $scope.GetPorjects();
};

$scope.GetPorjects = function () {
    var responsePromise = $http.get("http://localhost:21294/api/Project");

    responsePromise.success(function (listOfProjects) {
        $('#tblProjects').hide();
        $scope.newProject = {
            DeliveryManager: {},
            listOfSL:[],
            listOfTL:[],
            listOfCL:[]
        };
        $scope.projects = listOfProjects;
        //$scope.listOfUsers = listOfProjects.$scope.listOfUsers;
        $('#tblProjects').show('slow');
    });
    responsePromise.error(function (data) {
        toastr.error("Error calling service: ");
    });
}

0 个答案:

没有答案