Giter VIP home page Giter VIP logo

Comments (8)

davidwdan avatar davidwdan commented on July 17, 2024

What errors are you seeing in the browser's console?

from angular-wamp.

yabb85 avatar yabb85 commented on July 17, 2024

I have no eror message in browser's console.

All content of my console:
"session not open" angular.min.js:102

"Congrats! You're connected to the WAMP server!" angular.min.js:102
"We are connected to the WAMP Router!"

from angular-wamp.

davidwdan avatar davidwdan commented on July 17, 2024

Not much to go on there. Can you set a break point on that subscribe and then step through it. Angular doesn't display some exceptions when they're caught. If that doesn't give you anything, can you create a plunkr that reproduces the issue?

from angular-wamp.

yabb85 avatar yabb85 commented on July 17, 2024

I have a conflict between angular-wamp and http.get. I must inverted http.

my all code is:

var app = angular.module('myCart', ['vxWamp']);

app.config(function($wampProvider){
    $wampProvider.init({
        url: "ws://127.0.0.1:8080/ws",
        realm: "realm1"
    });
});


app.controller('courseCtrl', function($scope, $http, $wamp){

    $scope.id_list = window.location.pathname.split('/');
    $scope.id_list = $scope.id_list[$scope.id_list.length-1];

    /* Request to REST api */
    $http.get('/api/extended_list/1').success(function(data){
        $scope.bought = data.achats;
    }).
    error(function(data){
        console.log(data);
    });

    $http.get('/api/products/').success(function(data){
        $scope.items = data.products;
    }).
    error(function(data){
        console.log(data);
    });

    /* Wamp */
    //Executed at connection to wamp server
    $scope.$on("$wamp.open", function (event, session) {
        console.log('We are connected to the WAMP Router!'); 
    });

    //Executed after loose or close connection with wamp server
    $scope.$on("$wamp.close", function (event, data) {
        $scope.reason = data.reason;
        $scope.details = data.details;
    });

    function refreshList(args) {
        console.log('toto');
    }
    $wamp.subscribe('refresh_add_product', refreshList);

    /* Action */
    $scope.addToCart = function(id){
        $wamp.call('me.hory.add_to_list', [id, $scope.id_list]).then(
            function(res){
                console.log('product added to list');
            },
            function(error){
                console.log('impossible to add product in list');
            }
        );
    }

    $scope.removeToCart = function(id){
        $wamp.call('me.hory.remove_to_list', [id, $scope.id_list]).then(
            function(res){
                console.log('product removed to list');
            },
            function(error){
                console.log('impossible to remove product in list');
            }
        );
    }

});

app.run(function($wamp){
    $wamp.open();
})

from angular-wamp.

davidwdan avatar davidwdan commented on July 17, 2024

@yabb85 Are you saying that you had a conflict between angular-wamp and $http.get, but it's fixed now? Or are you still having issues?

from angular-wamp.

yabb85 avatar yabb85 commented on July 17, 2024

I don't understand.
If i use a break point this code is ok.
But without break point the page is not correctly displayed and i don't have an error in console.

from angular-wamp.

davidwdan avatar davidwdan commented on July 17, 2024

It sounds like you might have some sort of race condition. Can you recreate the issue with a plunker?

from angular-wamp.

yabb85 avatar yabb85 commented on July 17, 2024

Hi,
I have created a plunk at address: http://plnkr.co/edit/ChQKyoWkHdc1I2PFXw5o?p=linter
But with this plunker I have no issue.
The problem is my version of file autobahn.min.js

Thanks for help

from angular-wamp.

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.