I know that the ng-if directive creates a new child scope and I would like to know HOW and IF it is possible to play a ng-if into an other one.
For now I can\'t see any
I suggest to use the controllerAs syntax to ensure correct scope access and control.
HTML:
Parent is allowed
Children are allowed
Children are allowed
JS
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
var allowParent_ = true;
var allowChildren_ = false;
this.toggle = function() {
allowChildren_ = !allowChildren_;
}
this.showParent = function(){
return allowParent_;
}
this.showChildren = function() {
return allowChildren_;
}
});