Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-click won't work with dynamic includes

This fiddle demonstrates some code where I lazily add a partial with it's own controller.

Everything works fine, but for some reason my ng-click event just won't fire. Any idea what I'm doing wrong?

like image 589
Domi Avatar asked Jan 28 '26 19:01

Domi


1 Answers

You have to add the "()" in the ng-click

'<button ng-click="onClick()">Click</button>' +

See : http://jsfiddle.net/8Bf8m/22/

like image 83
BironDavid Avatar answered Jan 31 '26 09:01

BironDavid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!