santhosh santhosh - 1 year ago 58
AngularJS Question

Angular directive data binding not working inside ng-show

This is the example jsfiddle. I'm trying to

the value on click of some thing. but this value is not updating in
.I tried with
also . I'm sorry for poor english and newbie to

<div ng-click=show()>show directive</div>
<div ng-show="afterSomeTime">
<div class="star-rating" star-rating rating-value="rating"

data-max="10" on-rating-selected="rateFunction(rating)"></div>sdsadasdasd</div>

here i was trying to trigger directive after some click event but i was not able to achieve.check out that example js fiddle link

Answer Source

Start from line 43

    function(oldVal, newVal) { //<-this is where you did wrong
        if (newVal) {

Just swap oldVal and newVal, you should now make it work I believe.