Note that there are some explanatory texts on larger screens.

plurals
  1. POangular JS and inline editing data from REST
    primarykey
    data
    text
    <p>i am very new to angular. </p> <p>i am reading a JSONP response and showing it in a page. i would like to allow users to edit parts of the text inline. i found angular-xeditable. but i cant figure out 1. how do i use it in the repeater. i have spent several hours trying to use the inline edit. it works if its not in the repeater. otherwise breaks everything.<br/></p> <p>i have this: </p> <p>in my app.js: </p> <pre><code>var app = angular.module('ListApp', ['ui.bootstrap']).config(['$httpProvider', function ($httpProvider) { $httpProvider.defaults.useXDomain = true; delete $httpProvider.defaults.headers.common['X-Requested-With']; }]);; var app11 = angular.module("app11", ["xeditable"]); app11.run(function (editableOptions) { editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default' }); app11.controller('Ctrl', function ($scope) { $scope.user = { name: 'awesome user' }; }); angular.element(document).ready(function () { angular.bootstrap(document.getElementById('list-reminders'), ['ListApp']); angular.bootstrap(document.getElementById('xedittxt'), ['app11']); }); </code></pre> <p>in my html:</p> <pre><code>&lt;div id="list-reminders" class="container main-frame" ng-controller="remindersController" ng-init="init()"&gt; &lt;div class="search-box row-fluid form-inline"&gt; &lt;nobr&gt; &lt;label&gt;Find&lt;/label&gt;&amp;nbsp; &lt;input type="text" ng-model="searchText" value="{{searchText}}" /&gt;&amp;nbsp;&lt;input type="submit" class="submit" ng-click="getRemindersByUserId()" value="Search"&gt; &lt;/nobr&gt; &lt;/div&gt; &lt;div class="results-top"&gt;&lt;/div&gt; &lt;div class="results-container"&gt; &lt;div class="row-fluid"&gt; &lt;div class="span1"&gt;Title&lt;/div&gt; &lt;div class="span2"&gt;My Notes&lt;/div&gt; &lt;/div&gt; &lt;ul class="item-list" style="display:none;"&gt; &lt;li ng-repeat="(key,item) in lists"&gt; &lt;div class=" row-fluid"&gt; &lt;div id="xedittxt" ng-controller="Ctrl" class="span2"&gt; &lt;a href="" editable-text="{{item.user_reminder_title}}"&gt;&lt;/a&gt; &lt;/div&gt; &lt;div class="span2"&gt;{{item.user_notes}} &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>in my controller.js</p> <pre><code>app.controller("remindersController", function ($scope, $modal, $http) { $scope.items = []; //api $scope.getListApi = '....URL REMOVED'; var callback = 'callback=JSON_CALLBACK'; $scope.init = function () { //items selected from results to add to list $scope.selectedItems = []; var $loading = $('.loading'); var $searchOptions = $('.search-options'); var $itemList = $('.item-list'); $scope.getRemindersByUserId = function (userId) { $itemList.hide(); $loading.show(); var getListUrl = $scope.getListApi + "1&amp;" + callback; console.log(getListUrl); $http.jsonp(getListUrl).success(function (data) { $scope.lists = data; $loading.hide(); $itemList.show(); }).error(function (err) { console.log("getRemindersByUserId error: " + err); }); }; }; }); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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