× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

angularjs getting data from a url

Utkarsh Upadhyay
Apr 27, 2015
<p>You are not injecting your service (<code>dataService</code>) into your controller:</p> <pre><code>app.controller('ReCtrl', ['$scope', 'dataService', function($scope, dataService){ dataService.getdata(function(dataResponse) { $scope.fields = dataResponse; }); .... </code></pre> <p>Note the extra string <code>'dataService'</code> after <code>'$scope'</code> while defining the controller <code>ReCtrl</code>.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/29798946/angularjs%20getting%20data%20from%20a%20url/29798982">Stack Overflow</a>.</p>
comments powered by Disqus