我想在控制器中使用ng-model获得ng-init值

时间:2016-02-20 11:05:15

标签: angularjs

我希望hiddenVal中的ng-init值类似于stus

$scope.delTodo = function(id) {

  $http.post('delete.php', {
    stus: $scope.delstatus,
    hiddenVal: $scope.hidn
  }).then(function(data, status, headers, config) {
    //$scope.todocontent = response.data;
  });
};

** HTML code **

  <li ng-repeat="todo in todocontent track by $index">
                <p class="cls-{{todo.inc_id}}">{{todo.todoName}}</p>
                <input type="checkbox" ng-model="$parent.delstatus" ng-click="delTodo(todo)" ng-true-value="'{{todo.inc_id}}'" ng-false-value="'{{todo.inc_id}}'"  />
                <input ng-model="hidn" ng-init="hidn='{{inc_id}}'" type="hidden" name="fname"  >{{hidn}}
        </li>

0 个答案:

没有答案