javascript - AngularJS and WebSockets beyond -


I just read it, and I understand what the difference is but in my head is still the question Can I use it in the same app / website? Say I want to bring ingredients to Angulose and update my page, connect with a restore API and meet all the top things. But above this, I want a realtime chat, or when an update or message is received to trigger the incidents of other customers

What angular supports? Or socket me to trigger those events. Does it make sense to use both? If someone can help me or ask me to read something good about that if both are intended to be used together

Hope I am quite clear. Thank you for any help.

Javascript supports websitoc, so you do not need additional client-side framework to use it. is. Please declare it on it.

Actually you can listen for messages:

  $ connection.listen (function (msg) {return msg.type ==} "createdarminvent";}, Function (msg) {addTerminal (msg); $ scope. $$ step || $ scope. $ Applied ();});   

Listen once (great for request / response):

  $ connection.listen Once (function (data) {return data. CorrelationId and And data .correlationId == crrId;}). (Function (data) {$ rootScope.addAlert ({msg: "console" + data. Terminal type + "created", type: "success"})});   

Send more message:

  $ connection.send ({type: "terminal input rayest", input: CMD, terminal ID: $ scope.terminalId, correlationId: $ Connection.nextCorrelationId ()}); Normally, a websacet connection is bidirectional and you can also use it to obtain data from the server in the request / feedback model. You can have two models:  
  • Publisher / Subscriber : Where the client announces its interest in some topics and for messages of that topic Set handler, and

  • Request / Response : Where the client sends a message (or correlation ID) with a requestID, and a request for that Listen for a single reaction.

    However, if you want to be both, use REST to get more data, and WebSocket to get updates.

    In the server side, you may have to use the server-side framework for a backend with socket.io or websacet support.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -