AngularJs improvements

- Fixed injection error in factory.ts
- Use lambdas instead of the long function syntax.