public ActionResult Index()
{
ViewBag.total = false;
return View();
}
@{
var total= (string) ViewBag.total;
}
<div ng-if="total">
content here
</div>
Hi Marina,
Not sure about this approach but you can use "ng-show" directive in angular js to hide or unhide a div.
In your controller define a flag on scope like this
$scope.viewBagFlag = { hideShow : true };
and set $scope.viewBagFlag to false when your "viewBag" variable becomes false.
In your html use this flag to show or hide that div.
<div ng-show="viewBagFlag.hideShow">
</div>
Hope this helps!
Thanks,
Hirdesh
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
If your controller is also written in angular js then why not use same controller for that <div> page? In case there is a necessity to use a separated controller then you may have to write an angular service to pass values between controllers. There are other options as well like using $localStorage angular service or by using rootScope variable.
Thanks,
Hirdesh
<div ng-if="@ViewBag.total">
content here
</div>
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/wo8R1zVlq-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.