Sravya,
I don't think you can call the factory function from controller like that, as you can see it is not able to recognize the same. (I am not sure, may be some one else can help you on that).
But, here is an alternative if you wish to place the factory definition in controller: Plunker
Regards,
Sai Vellanki.