解决它。如果您使用的是图元,则引用将丢失。
检查一下:
更新的小提琴
app.factory("sharedScope", function($rootScope) { var scope = $rootScope.$new(true); scope.data = {text: "init text from factory"}; return scope;});app.controller("first", function($scope, sharedScope) { $scope.data1 = sharedScope.data;});app.controller("second", function($scope, sharedScope) { $scope.data2 = sharedScope.data;});


