Note that there are some explanatory texts on larger screens.

plurals
  1. POGet editable row of data from angular and sending it to WEB api
    primarykey
    data
    text
    <ol> <li><p>How do I send to the 'save' event the complete object including what ever the user has typed in that row? For now, those 2 fields are always NULL no matter what I do.</p></li> <li><p>(the temp comment) Where do I put this? I want to get the item data when the 'save' is clicked but I if I put it in there how do I refer to the specific row? </p></li> </ol> <p>The example I started with used separate pages for list/edit so the problem I am having is how to combine the functionality into one page.</p> <pre class="lang-javascript prettyprint-override"><code>var ListCtrl = function($scope, $location, Msa) { $scope.items = Msa.query(); //temp: since I do not know how to get the value for specific row var id = 1; $scope.msa = Msa.get({id: id}); $scope.save = function() { Msa.update({id: id}, $scope.msa, function() { $location.path('/'); }); } }; </code></pre> <pre class="lang-html prettyprint-override"><code>&lt;tbody&gt; &lt;tr ng-repeat="msa in items"&gt; &lt;td&gt;{{msa.PlaceId}}&lt;/td&gt; &lt;td&gt;{{msa.Name}}&lt;/td&gt; &lt;td&gt; &lt;div class="controls"&gt; &lt;input type="text" ng-model="msa.PreviousPlaceId" id="PreviousPlaceId"&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div class="controls"&gt; &lt;input type="text" ng-model="msa.NextPlaceId" id="NextPlaceId"&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div class="form-actions"&gt; &lt;button ng-click="save()" class="btn btn-primary"&gt; Update &lt;/button&gt;&lt;i class="icon-save"&gt;&lt;/i&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload