Skip to content

Instantly share code, notes, and snippets.

@msadoon
Last active August 29, 2015 14:08
Show Gist options
  • Save msadoon/ff2e1b62904c46a44a3b to your computer and use it in GitHub Desktop.
Save msadoon/ff2e1b62904c46a44a3b to your computer and use it in GitHub Desktop.
Unknown provider: $scopeProvider <- $scope <- BugService
<script>
var bugSummaryApp = angular.module('bugSummaryApp', []);
var bugslist = null;
var bugdetails = null;
bugSummaryApp.factory("BugService", ['$http', function(http) {
var webserviceURL = "/invokeWebService?webserviceHost=http://trceit-dev-env.elasticbeanstalk.com:8080&webservicePathURL=/getData";
http.get(webserviceURL).success(function(data) {
bugslist = data;
console.log('buglist ' + bugslist);
});
return {
all: function() {
console.log('bugdetails ' + bugdetails);
return bugslist;
},
one: function(idSelectedBug) {
return bugdetails;
}
};
}]);
bugSummaryApp.controller("ListControl", ["$scope", "BugService",
function(scope, BugService) {
scope.bugslist = BugService.all();
console.log('scope.bugslist' + bugslist);
}
]);
bugSummaryApp.controller("DetailControl", ["$scope", "BugService",
function(scope, BugService) {
scope.bugdetails = BugService.one();
}
]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment