shouldn't use console.log, inject the $log angular service instead.