Guest User

Untitled

a guest
Jul 15th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. var ws= new websocket("ws:/*********")
  2. ws.onmessage=function(message)
  3. {
  4. if(message)
  5. {
  6. if(message.type=="weather")
  7. {
  8. $state.go("Index.weather",{weatherObj:message});
  9. }
  10. if(message.type=="temperature")
  11. {
  12. $state.go("Index.temperature",{tempObj:message});
  13. }
  14. if(message.type=="humidity")
  15. {
  16. $state.go("Index.humidity",{humObj:message});
  17. }
  18. if(message.type=="rain")
  19. {
  20. $state.go("Index.rain",{rainObj:message});
  21. }
  22. etc..
  23.  
  24. }
  25. }
Add Comment
Please, Sign In to add comment