Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Scope.apply() for rerendering a template?

$
0
0

@Ionicoser wrote:

Hi all!

my example dosnt work. should i use directives and how they work?

Template:

<div ng-show="status == false">Not checked</div>
<div ng-show="status == true">Checked</div>

Part of the controller:

$http.post(url, _postData, config)
.success(function (data, status, headers, config) {
$scope.$apply(function () {
$scope.sendstatus = true;
});
})
.error(function (data, status, header, config) {
$scope.$apply(function () {
$scope.sendstatus = false;
});
});

So if the request give a success the template dosnt change. Any ideas?

Kind regards!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>