
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
an angular module to use ladda with ease. This module is different from other angular ladda modules you find on github.
WORK IN PROGRESS
Todo:
Do you know ladda? I love to use these button animations as load indicators in my angular apps. But their usage always came with a drawback .. I have to manage the loading state of the buttons somehow in my app. That means boilercode in my controllers .. even if you have an directive to handle ladda.
e.g., some typical controller and template code:
angular.module('app').controller('SomeController', SomeController);
SomeController.$inject = ['SomeResouce'];
function SomeController($resource) {
var vm = this;
vm.load = load;
vm.data = {};
vm.meta = {
ladda: false;
}
function load() {
vm.meta.ladda = true;
$resource.query().$promise.then(onSuccess).finally(onDone);
}
function onSuccess(data) {
vm.data = data;
}
function onDone() {
vm.meta.ladda = false;
}
}
...
<button ladda="vm.meta.ladda" ng-click="vm.load()">Load something!</button>
...
And this for every controller that handles some sort of http load/save/whatever. That sums up to a lot of boilerplate code just to handle ladda buttons
I think we can do better. I think we can do this without ANY boilerplate code in our controllers. Instead of telling every button to start or stop an indicator, we link every indicator to a http route. Becuase thats what it indicates, right?.
Lets rewrite the example above with ng-ladda:
angular.module('app').run(Setup).controller('SomeController', SomeController);
Setup.$inject = ['ngLaddaService'];
function Setup($ladda) {
// link a httpRequest to a unique event/name
$ladda.register('GET', '/some/resource/query', 'query-some-resource');
}
SomeController.$inject = ['SomeResouce'];
function SomeController($resource) {
var vm = this;
vm.load = load;
vm.data = {};
function load() {
$resource.query().$promise.then(onSuccess);
}
function onSuccess(data) {
vm.data = data;
}
}
...
<button ng-ladda="query-some-resource" ng-click="vm.load()">Load something!</button>
...
No boilerplate code in your controller (:cat:)
ng-ladda hooks into angular's $http provider and observes every request to trigger registered load-indicators via named events. The overhead to do this is very minimal.
install via npm:
npm install ng-ladda
Include js file via script tag or in your browserify bundle via require('ng-ladda');:
<script src="node_modules/ng-ladda/dist/ng-ladda.js" type="text/javascript"></script>
Setup your angular app:
angular.module('myapp', ['io.dennis.ladda']).config(Config);
Config.$inject = ['ngLaddaService']
function Config($ladda) {
// setup your routes ..
$ladda.register('GET', '/some/resource/query', 'query-some-resource');
}
Use the ladda-directive in your HTML:
...
<button ng-ladda="query-some-resource" ng-click="vm.load()">Load something!</button>
...
FAQs
an angular module to use ladda-loaders with ease
We found that ng-ladda 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 researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.