I have figured it out the problem.
The problem was bower install command. When I was posting this issue, bower install command was installing angular version 1.6.7 but now strangely installing 1.5.3 with a reference in bower.json file in angualr directory 1.6.7 . Today I have checked the official moodle mobile and saw that it was using angular 1.5.3. I have checked bower.json file and it has version 1.5.3 to be resolated. I think the issue was related to the angular-ionic version... If you encounter this problem check the angular version.