Javascript 在连续多次调用控制器后,PROMITE.then被取消,只有last返回数据

Javascript 在连续多次调用控制器后,PROMITE.then被取消,只有last返回数据,javascript,angularjs,angularjs-directive,Javascript,Angularjs,Angularjs Directive,我的问题是,我需要控制器的三个独立实例,我从html调用它 我的控制器是这样的 app.controller("overallCtrlDemo", function($scope,$rootScope,overAllService,lookupService,uiGmapGoogleMapApi) { var promise=overAllService.getOverAll(); promise.then(function(data){ $scope.t

我的问题是,我需要控制器的三个独立实例,我从html调用它

我的控制器是这样的

app.controller("overallCtrlDemo", function($scope,$rootScope,overAllService,lookupService,uiGmapGoogleMapApi)    {

    var promise=overAllService.getOverAll();
    promise.then(function(data){
        $scope.timeSeries1 = $rootScope.helpers.d3FormatJsonDualAxis(data.data);
        $scope.generic = $scope.timeSeries1;
        $scope.sunBurst = $rootScope.helpers.d3FormatSunburst(data.data);
    })

})
我在html中有三个指令

  • timeseries1(使用timeseries1数据)
  • 通用(使用通用数据)
  • sunBurst(使用sunBurst数据)
  • 但是当html呈现时,它调用控制器三次,但是 然后函数只返回最后一次调用的状态1。她看到了下面的图片

    <div id="topProduct-graph" class="chart no-padding"  ng-controller="overallCtrlDemo">
        <topproducts id = "topProducts" data-role="concentric" data-width=400 data-height=400  data-thickness=13 val=topProducts style="position:absolute;"></topproducts>
    </div>
    
    <div class="trendMap" style="width:1213px;" ng-controller="overallCtrlDemo">
        <generictimeseries id="genericTimeseries" val="generic" saleorquantity="saleOrQuantity"></generictimeseries>
    </div>
    
    
    

    a角度控制器总是调用一次。也许你需要一个指令?看我的编辑,还有一些其他问题,
    console.log
    来自哪里?我把console.log(promise)放在控制器中