Moved out  getting  functions. Now just passing function to templateUrl