Ng-click inside modal form not using same scope as ng-submit

Hey there!

I made a simple codepen to show you one strange behavior for a ng-click not launching a $scope.function() while in form whereas another ng-click is perfectly working out of the form.

Please see this codepen:

When you launch the login modal, the “Close” ng-click linked to $scope.closeLogin is working fine but when you click on the beer it’s not launching the $scope.doTestme function.

Weird isn’t it?

Hey! So I asked the same question on stackoverflow and one guru found the issue. In fact we can’t put an ng-click inside a label, we should use div instead.

The reason behind is that label is linked to form input only unlike div which is linked to current controller: