Fixed a silly mistake by using ng-click instead of onClick