<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          angular-sailsAngularJS 模塊

          聯(lián)合創(chuàng)作 · 2023-09-19 13:39

          angular-sails 是使用 Sails Socket.io API 的 AngularJS 模塊。

          據(jù)說(shuō),用了 Angular-sails,從此告別 Ajax!

          安裝

          bower install angular-sails
          

          使用示例

          var app = angular.module("MyApp", ['ngSails']);
          //OPTIONAL! Set socket URL!
          app.config(['$sailsProvider', function ($sailsProvider) {
              $sailsProvider.url = 'http://foo.bar';
          }]);
          app.controller("FooController", function ($scope, $sails) {
            $scope.bars = [];
            (function () {
              $sails.get("/bars")
                .success(function (data) {
                  $scope.bars = data;
                })
                .error(function (data) {
                  alert('Houston, we got a problem!');
                });
              $sails.on("message", function (message) {
                if (message.verb === "create") {
                  $scope.bars.push(message.data);
                }
              });
            }());
          });
          
          瀏覽 11
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  蜜桃av秘 无码一区二区 | 久久国产乱子伦精品一区二区豆花 | 亚洲黄色电影在线观看 | 6080乱伦| 免费在线性爱视频 |