我想從一個控制器到另一個控制器的數據,任何人都可以幫助我。例如:訪問另一個控制器的數據
.controller('firstCtrl',function($scope){
$scope.item = [{id:1, name:'John'},{id:2, name:'carter'},{id:3, name:'barsoom'},..]
})
.controller('secondCtrl',function($scope){
$scope.jsondata = item;
console.log(JSON.stringify($scope.jsondata));
})
是否有可能。誰能幫幫我嗎。謝謝。
的[如何共享在角應用控制器之間的數據以正確的方式](可能的複製http://stackoverflow.com/問題/ 34442752/how-to-share-data-between-controller-in-angular-app-in-the-the-way) – Andrew
嗨..感謝您的回覆。我已經發布了另一個[問題](http://stackoverflow.com/questions/37257798/accessing-data-from-one-controller-to-another),詳細地解釋 – naik3
請幫我解決這個問題。 – naik3