Get controller value in app.js from controller.js

心不动则不痛 提交于 2019-12-10 11:36:07

问题


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;   
                })
            }]
        }
      }
    }, 
  }) 

来源:https://stackoverflow.com/questions/28847987/get-controller-value-in-app-js-from-controller-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!