0

Goodday Folks, I have implemented a get or read operation using an AngularJS application to invoke a Isis service via an $http call. And displaying the collection on the screen using Angular ng-repeat. My next task is to do a create and update on the same entity using AngularJS. I am aware i have to send some parameters in the endpoint URL. Please, I need both Isis guidance and also importantly AngularJS hints or references or code. I think i should get some sort of acknowledgment to confirm the create or update is succesful. Below, is an extract from my code for the getList operation, just for starters. Your logic might be totally different from this. Thanks a lot.

sampleApp.controller('CrateUpdateController', function($scope, $http) {

    $http({ method:'GET',
        url: 'http://localhost:8080/xxx-webapp-1.0-SNAPSHOT/restful/services',
        headers: {'Accept': 'application/json'}
}).
        success(
        function (data) {
           //code to process outcome and acknowledgement etc
        }
      );
    });
Mega
  • 1,304
  • 5
  • 22
  • 37

2 Answers2

0

You should not mix so much different topics. A good practice is to distinguish the server side interface exposed by your HTTP server (Apache Isis) from the client side code accessing it.

This question should be break down to the following:

  • How to expose create and delete verbs for an existing resource in Isis
  • How to use create and delete verbs with Angular

The two topics are very different and it does not make so much sense to ask them together. The main point about having Isis exposing an HTTP interface is exactly to abstract from the client side logic.

As a side note, when accessing restful resources with Angular, try to use $resource instead of $http

danza
  • 11,511
  • 8
  • 40
  • 47
0

You might be best doing some Angular tutorials to learn the principles of that library. Then, (as I've mentioned before) take a look at using the Spiro library as the main interface to the RO server (Isis or RO.Net).

Dan Haywood
  • 2,215
  • 2
  • 17
  • 23