I am currently developing a directive that includes a custom controller, and I am testing the scope functionality. However, I am facing an issue where the ng-show directive is not functioning as expected when trying to test if the directive has a scope from my index page.
html
<div class="main">
<div ng-controller="rl">
<book-genres></book-genres>
<review-form ng-show="reviewFormCtrl.rating == 1"></review-form>
<input ng-click="reviewFormCtrl.rating = 3" type="button" value="Test" />
</div>
</div>
partial:
<div>
Review Forms : {{ rating }}
</div>
controller:
myApp.controller('rl', function(){
});
myApp.directive('reviewForm', function(){
return {
restrict: 'E',
templateUrl: 'partials/review-form.html',
replace: true,
scope: true,
controller: function($scope){
$scope.rating = 1;
},
controllerAs: 'reviewFormCtrl'
};
});