Access Data from Factory in angular
<ul>
<li><p>defining the module</p>

<pre><code>var app = angular.module("sachin", ["ng-fusioncharts"]);
//making a service
app.service('team',function(){
    var self = {
        'runs_aus':0
    };
    return self;

});
</code></pre></li>
<li><p>making a factory</p>

<pre><code>app.factory('taskFactory',function($scope,team){
    $scope.myDataSource = {
    chart: {
        caption: "Runs by opposition",
        subCaption: "Runs against each Team",
        numberPrefix: "",
        theme: "ocean"
    },
    data:[{
        label: "Australia",
        value: self.runs_aus
    },
    {
        label: "Pakistan",
        value: "7300"
    },
    {
        label: "South Africa",
        value: "5900"
    },
    {
        label: "West Indies",
        value: "5200"
    },
    {
        label: "England",
        value: "3300"
    }]
    };
    return myDataSource;
});
</code></pre></li>
<li><p>injecting factory and service in controller</p>

<pre><code>app.controller("myCtrl", function($scope,taskFactory,team){
console.log(taskFactory.myDataSource);
//can't access data over here
}
</code></pre>

<p>/*</p></li>
<li><p>all I want is to access the myDataSource variable in my Controller</p></li>
<li><p>How can I do that?</p></li>
<li><p>Thanks in Advance</p></li>
</ul>