1

My angularJs App URL is opened via another application. URL to open my app looks like,

http://localhost:21770/App/IAnalytics?FromApp=abc#/PBIDefault

where FromApp is the parameter which indicates the source app from where angularjs app is called.

I would like to remove the FromApp=abc part from URL once my home page controller starts running.

I need to make sure by URL looks like, http://localhost:21770/App/IAnalytics?#/PBIDefault

How can I achieve the same using $routeProvider or $location ?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Anup
  • 73
  • 2
  • 10

1 Answers1

0
  1. You look for params once your home page controller starts .
  2. If you find a parameter, you change the state of your app to the home page of the app (But without parameters this time). you can use $routeProvider, $location or $stateProvider for that.

Like this:

if ($location.search().FromApp){
$state.go('app.home',null, { reload: true }); // 'app.home' is name of your home page state.
}
Zain Mohsin
  • 97
  • 1
  • 11