Re: [rt-users] New UX for RT: REST 2.0, json, and what?

BÁLINT Bekény <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.devel
Message-ID <CAEMrJvC1smvefsWPPpGN37vc+iC2P0SEHwvUmsc_rhKNXH9n8Q@mail.gmail.com>
Hi Alex,

We will manage the code on github soon.

Now, it's really just an AngularJS "hello world":

<!doctype html>
<html ng-app>
    <head>
<title>AngularJS test: get ticket via RESTv2</title>
<script src="
https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js
"></script>
<script>
    function GetTicket($scope, $http) {
      $scope.addTicket = function() {
var tid = $scope.TicketId;
$http.get("https://lajos:[email protected]/REST/2.0/ticket/" + tid).
    success(function(data) {
            $scope.ticketdata = data;
    });
      };
    }
</script>
    </head>

    <body>
<div ng-controller="GetTicket">
    <form ng-submit="addTicket()">
    <input ng-model="TicketId">
    <p>test id : {{TicketId}}</p>
    <p>ID : {{ticketdata.id}}</p>
    <p>LastUpdated : {{ticketdata.LastUpdated}}</p>
    <p>Owner : {{ticketdata.Owner.id}}</p>
</form>
</div>
    </body>
</html>

--
Bekeny

On Thu, Apr 3, 2014 at 11:38 PM, Alex Vandiver <[email protected]>wrote:

> On Thu, 2014-04-03 at 23:33 +0200, [email protected] wrote:
>
> > Since then we've got some "hello world" thing:
> > - an angular client asks the user for a ticket id (via ng-model input
> > field),
> > - the angularjs code asks RT for some ticket head data (via REST),
> > - gets JSON answer from RT,
> > - and shows to the user on the html.
> >
> > small step, but we are happy :)
>
> Is your source control public yet?
>  - Alex
>
>
> --
> RT Training - Dallas May 20-21
> http://bestpractical.com/training
>

-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.