AngularJS and Pusher Real-time

1,308 views
Skip to first unread message

Nolan Dubeau

unread,
Apr 4, 2012, 3:47:16 PM4/4/12
to ang...@googlegroups.com
Hey folks!

I'm looking to collaborate with (or hire) someone on the list to help me build the Pusher Chat app - https://github.com/pusher/pusher-realtime-chat-widget using the latest version of AngularJS  (RC or 1.0).  I've been toying around with the code somewhat but have had a difficult time thus far particularly with how to wire up Pusher to an Angular service.  I've looked at the socket.io/node examples mentioned on the list but haven't been able to draw the correlation with the way Pusher is setup.  Pusher also allows you to transmit the name of the function name that you want to have executed once a message is received, so it seems like you would need to have a central function that receives the message from Pusher and then broker that to the appropriate function defined in the message.

Anyone interested? Colab or for hire?

Let me know!
Cheers,

Nolan


Nolan Dubeau

unread,
Apr 19, 2012, 6:56:52 PM4/19/12
to ang...@googlegroups.com
Hi everyone,

After looking at the Firebrand chat example I have started to try my hand at wiring up the Pusher Chat service.

Here is the start of a fiddle:  http://jsfiddle.net/rLNDu/

I'm sure there is a simple answer to this, but why is that the connectionStatus is not updated to Connected once the connection with Pusher is established.  

Your help is appreciated.  

Many thanks.

Nolan

bkc

unread,
Apr 19, 2012, 8:03:20 PM4/19/12
to ang...@googlegroups.com
The fiddle you pasted doesn't seem related to 'pusher' .. did you forget to click 'update' on your fiddle?

Nolan Dubeau

unread,
Apr 19, 2012, 9:44:13 PM4/19/12
to ang...@googlegroups.com, ang...@googlegroups.com
Shoot.  Yes I did. Sorry, still getting used to JSFiddle as well!  Will update shortly. Thanks. 

Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/MexHPbM9SYIJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Nolan Dubeau

unread,
Apr 19, 2012, 11:31:59 PM4/19/12
to ang...@googlegroups.com
Okay, so here is the updated fiddle:  http://jsfiddle.net/rLNDu/1/

Thanks again!

Nolan

On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:
On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:
On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:
On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:
On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:
On Wednesday, 4 April 2012 15:47:16 UTC-4, Nolan Dubeau wrote:

zdam

unread,
Apr 20, 2012, 12:14:41 AM4/20/12
to ang...@googlegroups.com
This fiddle  http://jsfiddle.net/zdam/rLNDu/3/  shows the connection status being updated

- you need to execute the code inside a $scope.$apply call because you are inside a callback that is 'outside' of the Angular world.  Whenever you are outside the Angular world you need to use $scope.$apply so that Angular 'applies' it's magic :)

Nolan Dubeau

unread,
Apr 20, 2012, 8:19:34 AM4/20/12
to ang...@googlegroups.com
Gotcha!  Thanks for your help. 


Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/0n_Lk6Z19UoJ.
Reply all
Reply to author
Forward
0 new messages