How to update $ scope.items using xeditable within form

0

In this example you can update the value of the field by clicking on the confirmation button, however on my form there is no button. What do I have to do to get this item / field updated?

My form in JSFiddle: link

HTML:

<h4>Angular-xeditable Text (Bootstrap 3)</h4>
<form ng-app="app" ng-controller="Ctrl" editable-form>
  <a href="#" ng-click="$form.$show();" e-ng-blur="$form.$hide();" editable-text="user.name">{{ user.name || 'empty' }}</a>
</form>

JavaScript:

var app = angular.module("app", ["xeditable"]);

app.run(function(editableOptions) {
  editableOptions.theme = 'bs3';
});

app.controller('Ctrl', function($scope) {
  $scope.user = {
    name: 'awesome user'
  };
});
    
asked by anonymous 01.06.2017 / 02:30

1 answer

0

Solution: link

HTML:

<h4>Angular-xeditable Text (Bootstrap 3)</h4>
<form ng-app="app" ng-controller="Ctrl" editable-form name="formulario">
  <a href="#" ng-click="formulario.$show()" ng-show="!formulario.$visible" editable-text="user.name">{{ user.name || 'empty' }}</a>
    <div class="buttons">
      <!-- buttons to submit / cancel form -->
      <span ng-show="formulario.$visible">
        <br/>
        <button type="submit" class="btn btn-primary" ng-disabled="formulario.$waiting">
          Save
        </button>
        <button type="button" class="btn btn-default" ng-disabled="formulario.$waiting" ng-click="formulario.$cancel()">
          Cancel
        </button>
      </span>
    </div>
</form>
    
01.06.2017 / 23:40