0

In my angularjs application I am using $emit and $on to show to different section of page.

For code refer to this link.

How to use $emit and $on of angularjs for two different controller stored in different path

Green tick code is working but its required two click in intervel then its working.

It should work on one click.

Community
  • 1
  • 1
Mohammed
  • 648
  • 2
  • 12
  • 32
  • Can you create a plunker or a fiddle with a minimal example? – Rambler Jan 17 '17 at 10:07
  • @Mohammed Are you using $emit or $broadcast? – Sidharth Panwar Jan 17 '17 at 10:10
  • I can. But thing is in my application I am redirecting a page to another page through a href tag.This is wont possible in fiddle. Else if I created jsfiddle without without redirecting it on another page then it will surely work But for my app I want to work with redirection. @SidharthPanwar – Mohammed Jan 17 '17 at 10:13
  • @Mohammed Can't you use $location for redirection? Is there a specific need to use $emit/$broadcast? – Sidharth Panwar Jan 17 '17 at 10:14
  • yes actually in my header file say view1 there is link1 and link2. Both link will be redirected same page say view2. Only difference is if I click one link one hen my view2 will load "Hello" and if I click on view2 my view2 will load "World". @SidharthPanwar – Mohammed Jan 17 '17 at 10:19

0 Answers0