Java Reference
In-Depth Information
<td><span
class="glyphicon
glyphicon-{{seat.booked ? 'ok' :'remove'}}"></span></td>
<td>
<button type="button"
class="btn btn-primary
{{seat.booked? 'disabled' :''}} btn-xs"
ng-click="bookTicket(seat)">Book
</button>
</td>
</tr>
</tbody>
</table>
The code is similar to the JSF tables we created in the earlier chapters. What is important
to us is that the
{{ }}
symbols are used by AngularJS to bind the displayed data with a
variable in a controller, which, in fact, is a representation of our REST endpoints.
Additionally, the
ng-click
directives are bound to the appropriate methods in the con-
troller. The
bookTicket
method issues a
seat.$book
call, which is propagated as a
POST
request to our backend.
We can now deploy our application to the server. After going to
ht-
tp://localhost:8080/ticket-agency-ws/index.html
in your browser,
you should see your application running, as shown in the following screenshot: