3

I'm fairly new with angularjs and javascript as a language. I don't need help with the sending and displaying, I'm using pusher to make it instant and ng-repeat to display the messages and all that part is working.

I'm having a problem creating a chat box for each user like facebook. I can understand one could use the jquery clone(). There also $compile in angular with I could use but I'm not sure which would be the best way to go about doing this.

I'm just looking for someone who knows what there doing!

Thanks, Alfred

Amr Elgarhy
  • 66,568
  • 69
  • 184
  • 301

1 Answers1

0

Have you got your code up on GitHub or somewhere that I can have a look at what you've got so far?

Without seeing any code it's tricky to give specific advice but with that said, this sounds like a good use case for ng-repeat and a "chat box" directive. If you have an array in your Angular code that stores all of the open chats you have with other people then you could use an ng-repeat in your view to display all of the chat boxes using a chat box directive.

hamchapman
  • 2,901
  • 4
  • 22
  • 37
  • Thanks for answering! http://jsfiddle.net/tL5nW/2/ I created a fiddle, left a rather long message in the css bit explaining everything. Your idea of how to do sounds amazing, Im just not sure how to make that a reality, anyway my description in the css bit in the fiddle explains everything, thanks! – user1919077 May 27 '14 at 23:24