Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular-sails
Advanced tools
This module allows you to use Sails.JS's awesome socket.io api with AngularJS.
Just add a dependency to your module and controllers and get it going!
Install it:
bower install angular-sails
You must also include sails.io-client in order to use this.
$http
?Angular Sails is a drop-in replacement for Angular's $http
service. If you are currently using $http
with sailsjs then switching to sockets is a snap, just replace $http
with $sails
!
A small example:
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 () {
// Using .success() and .error()
$sails.get("/bars")
.success(function (data, status, headers, config) {
$scope.bars = data;
})
.error(function (data, status, headers, config) {
alert('Houston, we got a problem!');
});
// Using .then()
$sails.get("/bars")
.then(function(resp){
$scope.bars = resp.data;
}, function(resp){
alert('Houston, we got a problem!');
});
// Watching for updates
$sails.on("bars", function (message) {
if (message.verb === "created") {
$scope.bars.push(message.data);
}
});
}());
});
Angular Sails mimics Angular's $http
service to provide a drop-in socket replacement for http.
For more information check out angular's $http
docs
Note: Angular Sails does not have a jsonp
method as jsonp is a specific implementation of HTTP
FAQs
An angular provider for using the sails socket.io api
The npm package angular-sails receives a total of 21 weekly downloads. As such, angular-sails popularity was classified as not popular.
We found that angular-sails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.