UNPKG

loopback-socket

Version:

Loopback module for create Socket.io connections and allow call methods and make subscriptions

82 lines (72 loc) 2.7 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --> <!-- <base href="/"> --> <title>LoopbackSocket sample</title> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <link rel="stylesheet" href="app.css" /> <script src="/socket.io/socket.io.js"></script> <script src="bower_components/angular/angular.min.js"></script> <script src="bower_components/angular-resource/angular-resource.min.js"></script> <script src="app.js"></script> </head> <body ng-app="app" ng-controller="MainController"> <div class="form"> <form name="loginForm" ng-submit="doLogin()"> <table> <tr> <td><label for="input-email">User</label></td> <td><input class="input-control full-width" id="input-email" name="email" type="text" ng-model="credentials.email"></td> </tr> <tr> <td><label for="input-password">Password</label></td> <td><input class="input-control full-width" id="input-password" name="password" type="password" ng-model="credentials.password"></td> </tr> <tr> <td><label>Estado</label></td> <td>{{ socket | socketState}}</td> </tr> <tr> <td></td> <td><input class="button full-width" type="submit" value="Submit"></td> </tr> </table> </form> </div> <div> <table class="table" cellspacing="1" cellpadding="1"> <tr> <th>Method</th> <th>args</th> <th>response</th> </tr> <tr> <td> <div><i>getProfile</i></div> <div><button class="button" ng-click="exec(getProfile, args.getProfile)">Call</button></div> </td> <td><pre>{{args.getProfile}}</pre></td> <td><pre>{{responses.getProfile}}</pre></td> </tr> <tr> <td> <div><i>getRecords</i></div> <div> <small>skip</small> <input class="input-control" type="text" ng-model="args.getRecords.skip"> </div> <div> <small>limit</small> <input class="input-control" type="text" ng-model="args.getRecords.limit"> </div> <div><button class="button" ng-click="exec(getRecords, args.getRecords)">Call</button></div> </td> <td><pre>{{args.getRecords}}</pre></td> <td><pre>{{responses.getRecords}}</pre></td> </tr> </table> </div> </body> </html>