Get controller value in app.js from controller.js

2019-06-06 04:32发布

问题:

Can anyone help me to pass the variable $scope.imageRepoUrl from controller.js to app.js

controller.js


    .controller('deallistCtrl', ['$scope','deals', function($scope, deals) {
        $scope.title = "test";
        $scope.deals = deals.payload;
        $scope.imageRepoUrl=$scope.$parent.imageRepoUrl;
        $scope.appWebUrl=$scope.$parent.appWebUrl;

    }])

app.js


  .state('app.deallists', {
    url: "/deallists",
    views: {
      'menuContent': {
        templateUrl: "templates/deallists.html",
        controller: 'deallistCtrl',
        resolve: {
            deals: ['$http', function($http){
                return $http.get('deal/deals').then(function(response){
                    return response.data;   
                })
            }]
        }
      }
    }, 
  })