Last active
August 29, 2015 14:08
-
-
Save msadoon/ff2e1b62904c46a44a3b to your computer and use it in GitHub Desktop.
Unknown provider: $scopeProvider <- $scope <- BugService
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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