title: How to get the Previous State with Params using ui-router
body: <p>Problem Statement : </p>
  
  <p>I have a button "add comment" , I should be able to add comment only when i have logged into the system.</p>
  
  <p>But problem is I cannot come back to "add comment" page after login, because I dont know the previous state or cannot get the previous state. </p>
  
  <p>Is there any cleaner solution to this ? Should i have login page a modal rather than a new page ? </p>
  
  <p>I have seen all the questions that is taking about previous state and also the possible answers ( yes, i am taking about $rootscope and $stateChangeSuccess). But it does not clearly put forward the solutions.</p>
  
  <p>Other possible solution is as below 
  <a href="http://christopherthielen.github.io/ui-router-extras/example/previous/index.html#" rel="noreferrer">http://christopherthielen.github.io/ui-router-extras/example/previous/index.html#</a></p>
  
  <p>I also saw 
  <a href="https://github.com/angular-ui/ui-router/issues/92" rel="noreferrer">https://github.com/angular-ui/ui-router/issues/92</a>. but again, i was not sure what is the correct answer. </p>
  
  <p>Could someone clearly state a good solution. Is using rootscope a good one ?</p>