-5

I have been using angularjs for developing web applications. I want to add the data filled in chatCtrl(controller) in chat.html to another controller (chatScrnCtrl) in chatScrn.html, i.r both the html are different through ng-view. I hope you get what im saying, im designing a web messenger application and i need to add the chat to the chatscreen once i type in the chatlist. I also need to display these in the chat history page. Hope u guys understand what i need. so pls provide a way for this rather than providing me the solution to access controllers in the same html file or the same js file.

santosh
  • 23
  • 1
  • 5

2 Answers2

1

try to utilize services provided by angularjs, use $broadcast to tranfer data between controllers

md-5h04I3
  • 214
  • 2
  • 12
0

You can write a angular service with Getters() and Setters() method and inject them in your controller.

Rohan Kawade
  • 453
  • 5
  • 18