For my first app using Angular, I have defined my service as:
angular.module('mean.testruns').factory('Testruns', ['$resource', function($resource) {
return $resource('testruns/:testrunId', {
testrunId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}]);
I have also added another URL on the rest server:
'/testcases/:testcaseId/testruns'
How can I incorporate this into the existing Testruns factory function?
My current controller looks like this:
$scope.findOfTestcase = function() {
//Need to correct this
Testruns.query({testcaseId:$stateParams.testcaseId}, function(testruns) {
$scope.testruns = testruns;
});
};
$scope.findOne = function() {
Testruns.get({
testrunId: $stateParams.testrunId
}, function(testrun) {
$scope.testrun = testrun;
});
};