Is it possible to activate an ng-include
and display the content only upon clicking a button? I attempted to use the ng-if
directive to show the div when the value of ng-model
is true
, however, this value remains unchanged in the myFunction
function.
<div ng-controller='myCtrl'>
<div ng-if='include==true' ng-include='"path"'></div>
<input type="button" ng-click='myFuntion()'/>
</div>
.controller('myCtrl', function($scope){
$scope.include = false;
$scope.myFunction = function(){
$scope.include = true;
}
})