How collaborate two Views and Controllers on the same page?

36 views
Skip to first unread message

angulajs-rocker

unread,
Apr 23, 2014, 8:30:34 AM4/23/14
to ang...@googlegroups.com
Hi All,

I have developed application with different views and controllers. For example:

when page loads:

1. One view 'A' is loaded with its specified controller in the app.js.
2. Navigate from view 'A' to second view 'B' with its specified view and controller.

We are using routing to navigate between the views.

Now the new requirement is we have to collabrate both the views in the single page.
They have remove routing concept and we have to collaborate the views in the single page.
All modules are opening up in pop-up now.

How I can use the existing code base without much changes in the code architecture?
Please help me. I am not perfect in the ANGULARJS. I stuck in it badly as they have changed the total design of the application.
Please help me. I will be very thankful to you.

Gabriel Aszalos

unread,
Apr 23, 2014, 9:17:00 AM4/23/14
to ang...@googlegroups.com
You could use:

a) a services (factory / service or provider)
b) directives for views, and have controllers expose an API (set up the require options so that they can communicate)
c) events, although this is not really recommended only for general app events

Google any of these things and you will find more details. Also, if they each run in pop-ups I don't think that 2 different browser windows can communicate with one another without having an intermediate layer (back-end)

sanket kumar singh

unread,
Apr 24, 2014, 7:14:49 AM4/24/14
to ang...@googlegroups.com
is this realy posible, if yes then please share. i am also interested on this.

Gabriel Aszalos

unread,
Apr 24, 2014, 7:23:04 AM4/24/14
to ang...@googlegroups.com
I think the only was to communicate between 2 browser windows is using cookies - or an extra back-end layer as previously mentioned


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/d7hrMeH9oss/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages