Remove from list
diff --git a/xos/core/xoslib/static/js/xosContentProvider.js b/xos/core/xoslib/static/js/xosContentProvider.js
index f001730..27164e4 100644
--- a/xos/core/xoslib/static/js/xosContentProvider.js
+++ b/xos/core/xoslib/static/js/xosContentProvider.js
@@ -90,7 +90,7 @@
}
};
})
-.directive('contentProviderList', function(ContentProvider) {
+.directive('contentProviderList', function(ContentProvider, lodash) {
return {
restrict: 'E',
controllerAs: 'vm',
@@ -105,6 +105,13 @@
.catch(function(e) {
throw new Error(e);
});
+
+ this.deleteCp = function(id) {
+ ContentProvider.delete({id: id}).$promise
+ .then(function() {
+ lodash.remove(_this.contentProviderList, {id: id});
+ });
+ };
}
};
})
diff --git a/xos/core/xoslib/static/templates/contentProvider/cp_list.html b/xos/core/xoslib/static/templates/contentProvider/cp_list.html
index 16db7b5..ddb0aa7 100644
--- a/xos/core/xoslib/static/templates/contentProvider/cp_list.html
+++ b/xos/core/xoslib/static/templates/contentProvider/cp_list.html
@@ -6,6 +6,7 @@
</th>
<th>Description</th>
<th>Status</th>
+ <th></th>
</tr>
</thead>
<tr ng-repeat="item in vm.contentProviderList">
@@ -18,6 +19,8 @@
<td>
{$ item.enabled $}
</td>
+ <td>
+ <a ng-click="vm.deleteCp(item.id)" class="btn btn-danger"><i class="icon icon-remove"></i></a></td>
</tr>
</table>
<div class="alert alert-error" ng-show="vm.contentProviderList.length == 0">