$resource not defined