reworking pub nub using the angularjs-pubnub js