Giter Club home page Giter Club logo

Comments (6)

cetra3 avatar cetra3 commented on June 21, 2024

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.

toutpt avatar toutpt commented on June 21, 2024

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:

f888e28

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.

cetra3 avatar cetra3 commented on June 21, 2024

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.

toutpt avatar toutpt commented on June 21, 2024

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.

toutpt avatar toutpt commented on June 21, 2024

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.

cetra3 avatar cetra3 commented on June 21, 2024

Yep, agree. This was before my time. Glad to have solved the mystery though.

from ngprogress.

Related Issues (20)

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.