Sure enough, by time I get desperate and post, think I found a solution. However, not sure if most efficient. Any thoughts if there is a better way?
Here's what I did:
Created a new Factory method:
callGetServiceWithParams: function (method, params) {
return $http({
method: 'GET',
url: $self.ServiceRoot + method,
headers: $self.Headers,
params: params
});
},
Then in my controller and init function passed in the parameters:
fbs.CourseListApp.controller("CourseListByCategoryIDController", function ($scope, $window, $log, dnnServiceClient) {
$scope.GetCoursesByCategoryID = function (siteid, categoryid) {
var promiseResp = dnnServiceClient.callGetServiceWithParams("CourseList/GetCoursesByCategoryID", $scope.params);
promiseResp.then(
function (payload) {
$scope.CourseList = payload.data; //careful, the name here is what you need to iterate through
},
function (errorPayload) {
$log.error('failure loading items', errorPayload);
}
);
}
//Special Init function ng-init, to pass in the server side info ModuleID, permissions to Edit
$scope.init = function (moduleId, moduleName, editable, siteid, categoryid) {
$scope.ModuleId = moduleId;
$log.ModuleId
$log.moduleName
$scope.EditMode = editable;
$scope.siteid = siteid;
$scope.categoryid = categoryid;
//?siteid=80&categoryID=3
$scope.params = {
"siteid": $scope.siteid,
"categoryid": $scope.categoryid
}
dnnServiceClient.init(moduleId, moduleName);
//done initializing, call the web API method
$scope.GetCoursesByCategoryID();
}
});