Giter VIP home page Giter VIP logo

angular-ladda's Introduction

angular-ladda's People

Contributors

jespermjonsson avatar radotzki avatar subicura avatar thetutlage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-ladda's Issues

ladda-text option?

Would have been really cool with a ladda-text option, which changes the buttons text to it's value when ladda is active, and back to original text when ladda is not active.

I'll make a pull req.

Btw, great work 💯

default style

it would be awesome to set the default animation instead of hard coding zoom-in

Adding ladda to a form wrecks validation

Hello,

I have following form which works totally OK:

<form role="form" name='signUpForm' novalidate>
            <fieldset>
                <legend>Create new account</legend>
                <div class="form-group" show-errors>
                    <label class="control-label" for="email">Your email address</label>
                    <input id="email" name="email" type="email" ng-model="registrationData.email" class="form-control" required>

                    <p class="help-block" ng-if="signUpForm.email.$error.required">You need to fill your email address.</p>
                    <p class="help-block" ng-if="signUpForm.email.$error.email">Given email address is invalid.</p>
                </div>

                <div class="form-group" show-errors>
                    <label class="control-label" for="password">Password</label>
                    <input type="password" name="password" id="password" ng-model="registrationData.password" class="form-control" placeholder="Password" required>

                    <p class="help-block" ng-if="signUpForm.password.$error.required">You need to fill out your password.</p>
                </div>
            </fieldset>
            <hr>

            <button class="btn btn-primary btn-block ladda-button">Sign up</button>

When I add Ladda with following code, the validation error messages are printed twice.

<form role="form" name='signUpForm' novalidate ladda="laddaLoad">
            <fieldset>
                <legend>Create new account</legend>
                <div class="form-group" show-errors>
                    <label class="control-label" for="email">Your email address</label>
                    <input id="email" name="email" type="email" ng-model="registrationData.email" class="form-control" required>

                    <p class="help-block" ng-if="signUpForm.email.$error.required">You need to fill your email address.</p>
                    <p class="help-block" ng-if="signUpForm.email.$error.email">Given email address is invalid.</p>
                </div>

                <div class="form-group" show-errors>
                    <label class="control-label" for="password">Password</label>
                    <input type="password" name="password" id="password" ng-model="registrationData.password" class="form-control" placeholder="Password" required>

                    <p class="help-block" ng-if="signUpForm.password.$error.required">You need to fill out your password.</p>
                </div>
            </fieldset>
            <hr>


            <button class="btn btn-primary btn-block ladda-button" ng-click="signUp()">
                <span class="ladda-label">Sign up</span>
            </button>

Also, writing a dot (.) in the email field somehow screws up focus. None of these things are happening without ladda.

Other libraries that are used in the project:

  • Mobile Angular UI
  • Angular JS 1.3.8
  • Angular Bootstrap Show Errors

TypeError: b.module(...).info is not a function

I got this error after rebuild angular, previously i build this project without error.
I have included this module in angular module and include all script in index.html.

Failed to instantiate module angular-ladda due to:
[$injector:nomod] Module 'angular-ladda' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument

i found shortcut to change file vendor.js to last vendor.js before error, and it's work. It isn't proper way to fix this problem.

Got this error when trying to install angular-ladda via Bower

Marissas-MacBook-Pro:~ Marissa$ bower install angular-ladda
bower not-cached https://github.com/remotty/angular-ladda.git#*
bower resolve https://github.com/remotty/angular-ladda.git#*
bower download https://github.com/remotty/angular-ladda/archive/0.4.3.tar.gz
bower extract angular-ladda#* archive.tar.gz
bower invalid-meta for:/var/folders/rg/2w1f9r6s6gv6fg1m3zj5xrl00000gn/T/Marissa/bower/e4888fb6124b03b2a432c7f046afcd03-16101-Lun2hp/bower.json
bower invalid-meta The "main" field cannot contain minified files
bower resolved https://github.com/remotty/angular-ladda.git#0.4.3
bower not-cached https://github.com/hakimel/Ladda.git#>=0.9.8
bower resolve https://github.com/hakimel/Ladda.git#>=0.9.8
bower download https://github.com/hakimel/Ladda/archive/1.0.0.tar.gz
bower retry Download of https://github.com/hakimel/Ladda/archive/1.0.0.tar.gz failed with EHOSTUNREACH, trying with git..
bower checkout ladda#1.0.0
bower ECMDERR Failed to execute "git clone https://github.com/hakimel/Ladda.git -b 1.0.0 --progress . --depth 1", exit code of #128 Cloning into '.'... fatal: unable to access 'https://github.com/hakimel/Ladda.git/': Couldn't connect to server

Additional error details:
Cloning into '.'...
fatal: unable to access 'https://github.com/hakimel/Ladda.git/': Couldn't connect to server
Marissas-MacBook-Pro:~ Marissa$

Inside UI-Bootstrap Modal with animation

When the directive is inside an animated view (one that expands or slides) the ladda directive calculates immediately forcing the height and width of the spinner to be 0px. Can we wrap the link function in a $timeout so that it can wait until the DOM is loaded?

Box visible below button

For the following code, using angular ladda version 0.3.1:

<button type="button" class="btn btn-success" data-dismiss="modal" ng-disabled="changeform.$invalid || !valuesChanged()" ng-click="submit()" ladda="loadingStatus.loading" data-style="expand-left">{{'Change' | translate}}</button>

I get an ugly box below the button when I click it. The ladda-spinner appears, but so does the box. (I wasn't quick enough to catch both at the same time though, so in this screen shot you can only see the ugly box):

angular-ladda

angular-ladda dependancy is missing when using bower install

As title says, I've double checked. Because i use grunt bowercopy to copy over only needed files from the bower_components dir, and because I had added the angular-ladda file (apparently bowerCopy does not give an error when copying missing files...huh?) this becomes a very hard bug to detect.

I think that this issue is trying to say the same but it does not really ehm... becomes clear :)

better to specify angular as peer dependency

As this package will mostly work with other angular third-party(or not) packages, non of them specify angular as dependency due to angular is a top dependency against these packages.

it could cause problems with npm 2.x.

Not working properly

I get this after setting ladda=true

screen shot 2015-10-25 at 01 02 44

Immediately, no animations at all. No matter which one I set.

Endless animation

Hi,

I keep getting an endless animation with the spinner. This my JS code to activate/deactivate the loading state.

function exportUserHistory() {
      if ( !vm.canExportHistory )
        return;

      vm.exportLoading = true;
      $scope.exportLoading = true;

      var json = JSON.stringify(historyItems),
          blob = new Blob([ json ], { type: 'application/json;charset=utf-8' });

      saveAs(blob, 'watch_history.json');

      setTimeout(function () {
        vm.exportLoading = false;
        $scope.exportLoading = false;
      }, 5000);
    }
<div>
        <button class="export-button"
                ng-class="{'export-button-disabled':!cleanvm.canExportHistory}"
                ng-disabled="!cleanvm.canExportHistory"
                ladda="cleanvm.exportLoading" <!-- or exportLoading with $scope -->
                ng-click="cleanvm.exportUserHistory()">
            Export Backup
        </button>
    </div>

I have tested with controllerAs and vm variable and $scope and it is the same result an endless animation. I have debugged and vm.exportLoading = false; $scope.exportLoading = false; are set to false.

I'm using "angular": "^1.5.6" and "angular-ladda": "^0.3.4"

(function () {
  angular
    .module('app.core')
    .config(laddaConfig);

  /* @ngInject */
  function laddaConfig(laddaProvider) {
    laddaProvider.setOption({ style: "zoom-in" });
  }
})();
(function () {
  angular
    .module('app.core', [ 'angular-ladda' ]);
})();

I cannot set size in options?

I tried this but didn't work.

angular.module(xxxx)
  .config(function (laddaProvider) {
    laddaProvider.setOption({
      style: 'expand-left',
      size: 35
    });
  })

"Invalid argument" error on IE11 debugging console

Error "Invalid argument" is generated using IE11 debugging console when the button label is a variable.

"Invalid argument" error on IE11 debugging console

<button type="submit" ladda="loading" ng-click="uploadResource()" ng-class="{disabled: uploadBtnDisable}" class="btn btn-success">{{uploadBtnText}}</button>

no error when wrapping within <span>

<button type="submit" ladda="loading" ng-click="uploadResource()" ng-class="{disabled: uploadBtnDisable}" class="btn btn-success"><span class="ladda-label">{{uploadBtnText}}</span></button>

no error when the button label is not a variable

<button type="submit" ladda="loading" ng-click="uploadResource()" ng-class="{disabled: uploadBtnDisable}" class="btn btn-success">Add Resource</button>

version of angular and ladda that we are using:

angular-ladda#0.1.9 app\components\angular-ladda
├── angular#1.3.8
└── ladda#0.9.4

Throws error when button is inside the form

not work in modal

I use ui-bootstrap's uibModal. I put the angular-ladda in script of 'text/ng-template'. And then it don't work

parsley novalidate problem

<html>
<body>
<form method="post" action="index.php" novalidate>
<input required data-parsley-length="[11,11]" data-parsley-type="number" type="text" id="cacel" name="cacel" class="form-control" placeholder="please cacel entery" value="">
<button type="submit" class="ladda-button btn btn-sm btn-blue" data-style="zoom-in"><i class="mdi mdi-content-save"></i> Save</button>
</form>
<script src="jquery.js"></script>
<script src="parsley.min.js"></script>
</body>
</html>

parsley chopping does not occur.
But he's still running on the ladda.
ladda should not work.

More Options in laddaProvider ?

Hey,
very good and easy understandable implementation of the ladda functionalities for angular.

For me (and certainly also for others) it would be great if i could set the spinner color globally in the laddaProvider on module config instead of in every html element. As i saw it, 'style' is the only option available right now, isn't it?

i would like to write my code like:

       laddaProvider.setOption({
            style: 'zoom-out',
            spinnerColor: '#FFB800'
        });

Is this or other option planed to be implemented?

Overwriting global variable "Ladda" ?

Note this line where you assign root.Ladda to factory(root.Ladda). But the factory doesn't return the Ladda object, so you're overriding the Ladda global. Doesn't mess me up, because I'm using CommonJS, but I imagine it would throw a bunch of other developers for a loop...

Instead, your factory should return the name of the module (like the angular core modules do). For more info, see this post.

Double curly binding broken after 0.1.10

Hi,

I have a page that needs to handle several ladda buttons, so what am currently doing is something like the following:

<div ng-repeat="row in $rows">
  <button ladda="loader{{ row.id}}">Action</button>
</div>

Back in 0.1.9, it worked fine. But after updating to the latest version, and trying to trace the bug, found that apparently 0.1.10's rewrite broke the directive. And now angular throws the following error:

Error: [$parse:syntax] Syntax Error: Token '{' is an unexpected token at column 18 of the expression [loader{{ row.id }}] starting at [{{ row.id }}].
http://errors.angularjs.org/1.3.9/$parse/syntax?p0=%7B&p1=is%20an%20unexpec…
    at REGEX_STRING_REGEXP (angular.js?body=1:64)
    at Parser.throwError (angular.js?body=1:11999)
    at Parser.parse (angular.js?body=1:11952)
    at $parse (angular.js?body=1:12661)
    at Scope.$get.Scope.$watch (angular.js?body=1:13816)
    at angular-ladda.js?body=1:43
    at angular.js?body=1:16207
    at completeOutstandingRequest (angular.js?body=1:4903)
    at angular.js?body=1:5283angular.js?body=1:11595 (anonymous function)angular.js?body=1:8545 $getangular.js?body=1:16210 (anonymous function)angular.js?body=1:4903 completeOutstandingRequestangular.js?body=1:5283 (anonymous function)

Not sure if I should follow another approach to control several "dynamic" ladda buttons in the same page. So will downgrade to 0.1.9 in the meanwhile.

Making angular-ladda work with browserify

angular-ladda doesn't work properly with browserify, since it references the Spinner and Ladda libraries, which are not proper AMD modules (and are also not always used as such in angular-ladda's code).

I have managed to make it work (so I figured I should write it here in case it might help someone else):

  • npm install --save browserify-shim
  • in your package.json, add the following object:
"dependencies": {
    ...
},
"browserify-shim": {

    "ladda": "global:Ladda",

    "spin.js": "global:Spinner"

}
  • require Spinner, Ladda and angular-ladda wherever you usually require external modules (the ordering here is important):
window.Spinner = require('/components/ladda/js/spin');
window.Ladda = require('/components/ladda/js/ladda');
require('/components/angular-ladda/dist/angular-ladda');
  • Simply inject 'angular-ladda' in the relevant module, and that should do it.
angular.module('moduleName', [
    'angular-ladda'
])

bower install not giving dist folder for "ladda" repo

After running bower install angular-ladda --save I get the ladda folders, but I'm not getting the dist folder along with the install. It appears that ladda no longer supports bower, so the ladda dependencies for angular-ladda needs to get set to a 1.X version.

Requirejs / AMD support?

Using angular-ladda with requirejs leads to an issue:

ReferenceError: Ladda is not defined

...since Ladda is no longer defined on the global scope. Any way to resolve this? Thanks!

Ladda spinner not showing when button also has ngDisabled

I have a button that looks like the below. When I remove the ng-disabled everything works fine, otherwise the spinner never appears.

<button
  ladda="vm.runningReport"
  data-style="zoom-in"
  class="btn btn-default"
  uib-tooltip="Run Report"
  tooltip-placement="top"
  ng-disabled="vm.parameters.length > 0 && !vm.parametersSupplied(vm.parameters.values)"
  ng-click="vm.run(query)">
  <i class="glyphicon glyphicon-play text-primary"></i>
</button>

ladda button style has ploblem

Hi, I use angular-ladda with boostrap btn class, then I clicked on button function is find but style is not appear like example, see on image below

screen shot 2558-10-26 at 14 42 42

Minified version error

Hi
I downloaded your library, but when i want to use the minified version i always receive a "Syntax Error" in my console (Internet explorer 11).

Also, the minified version requires 64KB and the normal version 4KB. Why? :)

Not working with ui bootstrap modal

Hello,
this is not working when you set your directive on modal footer buttons when using Bootstrap UI's modal component.

I think it is because the modal is destroyed then recreated again.

Here is a demo : https://jsfiddle.net/prbaron/ru1p5y38/
attended : When you click on the OK button, it should show a loader.
result : there is no loader.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.