Answer the question
In order to leave comments, you need to log in
How to change ng-show state using AngularJS?
Before clicking the button, the section is shown and there is 1 in it. I want to click on the button so that this section is hidden, but it is not hidden, although its ng-show states change
before the click:
after the click:
<body ng-controller="UnitrackController as u">
<section id="login" ng-model="u.login_visible" ng-show="{{u.login_visible}}">
1
<div ng-controller="UnitrackLogin as login">
<button ng-click="viewRegistration()">кнопка</button>
</div>
</section>
</body>
app.controller('UnitrackController', function($scope){
this.login_visible = true;
that = this
$scope.setLogin_visible = function(value){
that.login_visible = value;
}
}).controller('UnitrackLogin', function($scope){
$scope.viewRegistration = function(){
$scope.setLogin_visible(false)
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question