angularjs - Angular spinner is not appearing -
i using urish/angular-spinner not working when try use in controller through $scope.startspin()
, $scope.stopspin()
;
please find plunker @ plunker. here spinner not appearing @ all.
the following code starting , stopping spinner.
$scope.startspin(); dashboardsdataservice.getnetspendovertimedata() .then(function(data) { $scope.data = data; $scope.stopspin(); });
it simple need remove
spinner-key="spinner-1"
and work fine!
the final code
<!doctype html> <html ng-app="myapp"> <head> <meta charset="utf-8" /> <title>angularjs plunker</title> <script>document.write('<base href="' + document.location + '" />');</script> <link rel="stylesheet" href="style.css" /> <script data-require="angular.js@1.2.x" src="https://code.angularjs.org/1.2.16/angular.js" data-semver="1.2.16"></script> <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="http://fgnass.github.io/spin.js/spin.min.js"></script> <script type="text/javascript" src="angular-spinner.js"></script> <script src="app.js"></script> <script src="services.js"></script> <script src="controllers.js"></script> </head> <body ng-controller="mainctrl"> <span us-spinner="{radius:30, width:8, length: 16}" ></span> <div> <pre class="code">{{data | json }}</pre> </div> </body> </html>
plnkr
Comments
Post a Comment