• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ladda button directive for angularjs

license travis bower npm

ladda-angular

Angularjs directive for Ladda button ( <300 bytes ) by @hakimel

Demo

Ladda angular

You can also check live demo on codepen

How to use

Bower

You can Install ladda-angular using the Bower package manager.

$ bower install ladda-angular --save

npm

You can also find ladda-angular on npm.

$ npm install ladda-angular

Create your ladda button

For more information about how to create ladda button please refer ladda button repository.

The code

add the Following code into your document.

<script src="path/ladda-angular.min.js"></script>

module

Add ladda dependency to your module

var myApp = angular.module("app", ["ladda"]);

directive

Add directive ladda-button with your normal ladda button.

<button ladda-button="laddaLoading" data-style="expand-right" class="ladda-button"><span class="ladda-label">Submit</span></button>

Directive attribute should be a scope variable with boolean or number.

  • true == start loading.
  • false == stop loading.
  • number == progress value.

Controller example

app.controller('laddaDemoCtrl', function ($scope, $interval, $timeout) {
    
    // Example without progress Bar
    $scope.showLoading = function () {
        /* 
         Set ladda loading true
         Loading spinner will be shown;
        */
        $scope.laddaLoading = true;
        $timeout(function () {
            
            /*
             Set ladda loading false after 3 Seconds. 
             Loading spinner will be hidden;
            */
            $scope.laddaLoading = false;
        }, 3000);
    };

    // Example with progress Bar
    $scope.loadingWithProgress = function () {
        
        // Set progress 0;
        $scope.laddaLoadingBar = 0;
        
        // Run in every 30 milliseconds
        var interval = $interval(function () {
            
            // Increment by 1; 
            $scope.laddaLoadingBar++;
            if ($scope.laddaLoadingBar >= 100) {
                
                // Cancel interval if progress is 100
                $interval.cancel(interval);
                
                //Set ladda loading false
                $scope.laddaLoadingBar = false;
            }
        }, 30);
    };
});

guidelines for contributors

MIT Β© Sachin

More Repositories

1

lightGallery

A customizable, modular, responsive, lightbox gallery plugin.
TypeScript
6,371
star
2

lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
JavaScript
5,270
star
3

lightslider

JQuery lightSlider is a lightweight responsive Content slider with carousel thumbnails navigation
JavaScript
2,044
star
4

replace-jquery

Automatically finds jQuery methods from existing projects and generates vanilla js alternatives.
JavaScript
1,152
star
5

lightgallery-desktop

A modern, electron and nodejs based image viewer for Mac, Windows and Linux.
JavaScript
993
star
6

ngclipboard

An angularjs directive to copy text to clipboard without using flash
JavaScript
387
star
7

angular-trix

A rich WYSIWYG text editor directive for angularjs.
JavaScript
330
star
8

angular-flash

A simple lightweight flash message module for angularjs
JavaScript
261
star
9

tiny-events.js

TinyEvents is a tiny event utility library for modern browsers(IE 11+). Supports jQuery-like syntax. Just 1 kb gzipped.
TypeScript
22
star
10

lg-thumbnail

Thumbnail module for lightGallery
JavaScript
12
star
11

lg-video.js

Video module for lightgallery.
JavaScript
10
star
12

lg-zoom

Zoom module for lightGallery
JavaScript
10
star
13

lg-thumbnail.js

Thumbnail module for lightgallery.
JavaScript
8
star
14

lg-fullscreen.js

Fullscreen module for lightgallery.
JavaScript
6
star
15

lg-video

Video module for lightGallery
JavaScript
6
star
16

lg-zoom.js

Zoom module for lightgallery.
JavaScript
6
star
17

lg-share

Social media share module for lightgallery.
JavaScript
5
star
18

lg-pager.js

Pager module for lightgallery.
JavaScript
3
star
19

lightgallery.js-anguar-demo

Using lightgallery.js in Angular
HTML
2
star
20

lg-fullscreen

JavaScript
2
star
21

lg-rotate

Rotate plugin for lightGallery
JavaScript
2
star
22

lightgallerywp

WordPress plugin for lightGallery
PHP
1
star
23

lg-share.js

Social media share module for lightgallery.
JavaScript
1
star
24

lg-hash

Hash module for lightGallery
JavaScript
1
star
25

lg-pager

Pager module for lightGallery
JavaScript
1
star