It's very close but you have a slight mistake in your app instantiation. It should be the following:
var app = angular.module('myapp', [ 'apiService' ]);
There's a couple other issues I see as well but one thing is I usually do the following for async requests
var promise = UserFactory.get({}).$promise;
promise
.then( function(response) {
$scope.time = userFactory.time;
});
EDIT: Here's an example for named methods for a given ReST service:
return $resource('/api/v2.0/user/lists/:listId',
{},
{
// POST - list create/product addition to list
'addProduct': {
method: 'POST',
isArray: false,
params: {
listId: '@listId',
productId: '@productId'
}
},
'createList': {
method: 'POST',
isArray: false,
params: {
listName: '@listName'
}
},
// GET - list of user lists/list details
'readLists': {
method: 'GET',
isArray: false,
params: {}
},
'readListsWithProductId': {
method: 'GET',
isArray: false,
params: {
productId: '@productId'
}
},
'readListById': {
method: 'GET',
isArray: false,
params: {
listId: '@listId',
sort: '@sort',
flags: true,
extendedInfo: true,
rows: '@rows',
start: '@start'
}
},
// PUT - list renaming
'renameList': {
method: 'PUT',
isArray: false,
params: {
newName: '@listName',
listId: '@listId'
}
},
// DELETE - list deletion/clear/product removal
'removeProduct': {
method: 'DELETE',
isArray: false,
params: {
listId: '@listId',
productId: '@productId'
}
},
'clearList': {
method: 'DELETE',
isArray: false,
params: {
listId: '@listId',
clear: true
}
},
'deleteList': {
method: 'DELETE',
isArray: false,
params: {
listId: '@listId'
}
}
});
You could access it like the following:
Factory.[methodName](payload)