Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 可执行表单不会提交_Angularjs - Fatal编程技术网

Angularjs 可执行表单不会提交

Angularjs 可执行表单不会提交,angularjs,Angularjs,我正在使用Xeditable更新用户信息 我的表格如下所示: <form editable-form name="updateUser" onaftersave="updateUser()"> <div class="clearfix m-b"> <span class="thumb-sm"><img src="{{user.image_path || 'img/AdamProfil.png'}}" alt="{{user.profile

我正在使用Xeditable更新用户信息

我的表格如下所示:

<form editable-form name="updateUser" onaftersave="updateUser()">
   <div class="clearfix m-b">
     <span class="thumb-sm"><img src="{{user.image_path || 'img/AdamProfil.png'}}" alt="{{user.profile.firstname}} {{user.profile.lastname}}" class="img-circle" /></span>
     <div class="m-t-xs m-b-xs">
       <h4 class="h4">{{ selectedUser.profile.firstname }} {{ selectedUser.profile.lastname }}</h4>
       <small class="block">{{ selectedUser.title.name }} - {{ selectedUser.Division.name }}</small>
     </div>
     <article class="media">
       <small class="text-uc text-sm text-muted">Privat</small>
       <div class="form-group m-b-xs">
         <label class="font-bold block m-b-none" for="selected_address">Addresse</label>
         <small class="block" id="selected_address" editable-text="selectedUser.profile.address" e-form="">{{ selectedUser.profile.address || 'Ikke udfyldt' }}</small>
       </div>
       <div class="form-group m-b-xs">
         <label class="font-bold block m-b-none" for="selected_username">Email</label>
         <small class="block" id="selected_username" editable-email="selectedUser.username">{{ selectedUser.username || 'Ikke udfyldt' }}</small>
       </div>
       <div class="form-group m-b-xs">
         <label class="font-bold block m-b-none"  for="selected_phone">Telefon</label>
         <small class="block" id="selected_phone" editable-text="selectedUser.profile.phone">{{ selectedUser.profile.phone || 'Ikke udfyldt' }}</small>
       </div>
       <div class="form-group m-b-xs">
         <label class="font-bold block m-b-none" for="selected_cpr">Fødselsdag</label>
         <small class="block" id="selected_cpr" editable-text="selectedUser.profile.cpr">{{ selectedUser.profile.cpr || 'Ikke udfyldt' }}</small>
       </div>
       <div class="form-group m-b-xs">
         <label class="font-bold block m-b-none" for="selected_description">Bemærkninger</label>
         <small class="block" id="selected_description" editable-text="selectedUser.profile.description">{{ selectedUser.profile.description || 'Ikke udfyldt' }}</small>
       </div>
   </article>
   <hr class="b-b">
   <button type="submit" class="btn btn-default btn-rounded" ng-disabled="updateUser.$waiting" ng-show="updateUser.$visible" tooltip="Gem"><i class="fa fa-floppy-o"></i></button>
   <button type="button" class="btn btn-grey btn-rounded" ng-disabled="updateUser.$waiting" ng-click="updateUser.$cancel()" tooltip="Annuller"><i class="fa fa-ban"></i></button>
   </div>
</form>
我的问题是,当我尝试提交表单时,它会给我以下错误,因此无法运行控制器:

$scope.updateUser = function()
{
    $http({url: api.getUrl('user', user.id),
        method: "PUT",
        data: { user: user }
    }).success(function (data, status, headers, config) {
    }).error(function (data, status, headers, config) {
    });
};
TypeError: Cannot read property '0' of null
    at $parseFunctionCall (angular.js:12337)
    at FormController.e.ngSubmit.e.submit.e.onaftersave.g.$onaftersave (xeditable.min.js:6)
    at FormController.g.$save (xeditable.min.js:6)
    at val (angular.js:1002)
    at c (xeditable.min.js:6)
    at Object.then (xeditable.min.js:6)
    at FormController.a (xeditable.min.js:6)
    at angular.js:997
    at c (xeditable.min.js:6)
    at Object.then (xeditable.min.js:6)
我已经找了一段时间了,找不到任何有用的东西。而且我在Angularjs还是个新手