Skip to content

Instantly share code, notes, and snippets.

Trey Richards treyrich

Block or report user

Report or block treyrich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@treyrich
treyrich / Example.js
Last active May 30, 2017
This is an AngularJS provider to communicate with a Sails.js backend via Socket.IO.After searching for way too long for a way to interface with the Sails.js client-side SDK included in new Sails projects via AngularJS I decided to write a drop in replacement for the AngularJS $http provider.Although this isn't a full replacement it includes a nu…
View Example.js
angular.module("MyApp", ["SocketProvider"])
.controller("MyController", ["$scope", "socket", function($scope, socket) {
// Fetch initial data
$scope.person = null;
socket.get("/person/1").success(function(data) {
$scope.person = data;
}).error(function() {
You can’t perform that action at this time.