angular-sails

程序名称:angular-sails

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

angular-sails 介绍

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

据说,用了 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);
      }
    });
  }());
});

angular-sails 官网

https://github.com/janpantel/angular-sails

相关编程语言

MuPlayer 是一款跨平台、轻量级的音频播放解决方案,...
OS FLV 是一个 开源和可嵌入网页的flv播放器。 这个...
DewPlayer音乐播放器,样式很简单,而且很实用.播放器...
JW FLV MEDIA PLAYER是一个开源的在网页上使用的Fla...
Speakker 是一个基于 Web 浏览器的音乐播放器,只提...
Player Framework 是一个开源的支持 HTML5 的视频播...