Comments (6)
I'd need to see your controller to find out what is going wrong
You should inject the ngProgressFactory:
var MainCtrl = function($scope, $timeout, ngProgressFactory) {}
Then in your controller's function, create an instance of ngProgress:
$scope.progressbar = ngProgressFactory.createInstance();
from ngprogress.
I think it's more a bug than a question because it works on 1.0.
I have injected 'ngProgress' into the controller:
function msgService($uibModal, notificationService, ngProgress, errorMsgService, gettextCatalog) {
'ngInject';
...
cf capture for the code
If I look to the source: https://github.com/VictorBjelkholm/ngProgress/blob/master/src/provider.js#L3
.service('ngProgress', function () {
So It should be possible to use 'ngProgress' but it's not.
Because it returns something that is not a service:
return ['$document', '$window', '$compile', '$rootScope', '$timeout', function($document, $window, $c
And as I said It works on the 1.0 but not on the 1.1
and I have found the commit that broke my code:
So it means 'ngProgress' is not a service anymore ?
Now I need to change from 'ngProgress' to 'ngProgressFactory', create an instance and put it into the scope. You may add a note for this migration path from 1.0 to 1.1
or fix it to be usable as a service.
from ngprogress.
Yeah, it may be worthwhile as a note in the readme for upgrading. I have a feeling it was changed to allow multiple instances of ngProgress at any given time.
from ngprogress.
A question, do that work on 1.0 ?
--- a/src/framework/messages.js
+++ b/src/framework/messages.js
@@ -106,9 +106,10 @@
* @name swif.framework.msgService
* @description this service provide an API to display feedback to the user.
**/
- function msgService($uibModal, notificationService, ngProgress, errorMsgService, gettextCatalog) {
+ function msgService($uibModal, notificationService, ngProgressFactory, errorMsgService, gettextCatalog) {
'ngInject';
var messages = [];
+ var ngProgress = ngProgressFactory.createInstance();
from ngprogress.
I understand, adding features is always great but breaking changes are bad
(at least 1.0 -> 1.1 should be minor changes).
To handle this I'm using https://github.com/semantic-release/semantic-release which pump major release depending on your commit message and that is great !
from ngprogress.
Yep, agree. This was before my time. Glad to have solved the mystery though.
from ngprogress.
Related Issues (20)
- website HOT 4
- Update link reference HOT 1
- Fix naming in bower.json HOT 1
- Broken API? HOT 1
- Typescript definition file HOT 1
- Versions missing from npm HOT 9
- 'main' referenced in package.json doesn't exist. HOT 4
- setParent() not work HOT 4
- Bower Install Warning HOT 2
- ngProgressFactory function misses it's dependencies HOT 3
- ngProgressFactory injection failed HOT 1
- Documentation issue HOT 1
- progressbar.complete() shouldn't animate unless it has been started
- first param in $timeout&progress speed HOT 1
- TypeError: 'undefined' is not an object (evaluating 'this.parent.appendChild')
- after deploy code in enviroment - ngprogress version not found HOT 1
- NPM Version Request HOT 4
- IE not reflecting DOM updates and progress bar is delayed until the page is nearly done loading HOT 1
- Request for new maintainer HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngprogress.