Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Disconnect strophe js from another angular controller

    • 1
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 712
    Answer it

    Hello! I make a connection to an xmpp server using node-xmpp-bosh.From my app i'm using strophe js to connect.I have two controllers.I make connection in first controller.In second controller i want to close connection .I've tried but i need to establish a new connection and after to disconnect from this.Is a problem because strophe need about 3 sec to connect.I want to see this connection status in the second controller to not connect again.How should i do this ?Thanks for any help

 1 Answer(s)

  • As per my understanding from your query, you should store the strophe connection in a rootScope variable which make you able to handle the connection in another controller also.
    You can also use $broadcast or $emit incase your controllers are following child - parent relation.

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: