从controller.js获取app.js中的控制器值

时间:2015-03-04 06:32:32

标签: angularjs cordova ionic-framework phonegap-build

任何人都可以帮我传递变量 $ scope.image从controller.js到app.js的Repo Url

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

0 个答案:

没有答案