In my application, am loading views using ngRoute,
.state('ReportViewer', { url: "/ReportViewer", controller: 'ReportViewerControl', templateUrl: "views/Report_viewer.html" }) I have a search Panel where users can search reports, and when selecting a report, it should route to a different page and load the report inside an iframe. Here is my code when the user select the report,
$scope.goReport = function(report){ $state.go('ReportViewer'); } I have defined a constant in the config which changes dynamically based on the report selection
.constant('Digin_ReportViewer','http://192.226.192.147:8080/api/repos/%3Ahome%3Aadmin%') Here i need to pass the 'Report' variable to the ReportViewerControl when the user select the report,
Here is my ReportViewerControl
routerApp.controller('ReportViewerControl', ['$scope', '$routeParams','Digin_ReportViewer',function($scope, $routeParams,Digin_ReportViewer) { //here i need to append the report url , $scope.reportURL = Digin_ReportViewer+routeParams.report ; $scope.trustSrc = function(src) { return $sce.trustAsResourceUrl(src); } } ]);