Answer the question
In order to leave comments, you need to log in
How to change ng-if value from controller?
<div class="office-block" ng-if="true">
</div>
myApp.controller("homeCtrl", function($scope, $location){
$scope.saveOffice = function (office) {
$scope.clientsInfo = office;
if (office != ""){
// код который будет изменять ng-if
};
};
});
Answer the question
In order to leave comments, you need to log in
ng-if="function()"
function() {
If () return true
else
return false
}
<div class="office-block" ng-if="isShow">
</div>
myApp.controller("homeCtrl", function($scope, $location){
$scope.isShow = false;
$scope.saveOffice = function (office) {
$scope.clientsInfo = office;
if (office != ""){
// код который будет изменять ng-if
$scope.isShow = !$scope.isShow;
};
};
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question