How to define properties in angularJS controller so that a function can be invoked on using the property in view