Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-click in the inner template of the directive is not providing the functionality

ng-click is not providing alert. When the inner template of the directive is clicked alert box is not shown.

The fiddle link is here: http://jsfiddle.net/NNDhX/

like image 357
user1966260 Avatar asked Jan 10 '13 10:01

user1966260


1 Answers

I don't know if this is the best way but you can use $parent in directive to access parent scope.

<a ng-click="$parent.hi();">parent</a>

Here is link to full fiddle example: http://jsfiddle.net/EKDse/

like image 81
Christopher Gibała Avatar answered Oct 04 '22 23:10

Christopher Gibała