I'm trying to display an element based on a scope variable. I can't seem to get it to work. Since $scope.hi exists I'd like the word "Active" to show up. Here is my code:
var app = angular.module('app', ['ngTouch', 'ui.grid']);
app.controller('MainCtrl', function ($scope, $timeout) {
$scope.hi = true;
$scope.gridOpts = {
columnDefs: [
{ name:'name', field: 'name' },
{ name:'isActive', field: 'isActive'},
{ name:'template',cellTemplate:'<div><a ng-show="hi">Active</a><a ng-hide={{row.entity.isActive=="N"}}>Deactive</a></div>'}
]
};
$scope.waiting = "Waiting...";
$timeout(function () {
$scope.gridOpts.data = [{ name: 'Bob' ,isActive:'Y'}];
}, 3000)
.then(function() {
$timeout( function() {
$scope.gridOpts.data = [{ name: 'John',isActive:'N' }];
}, 3000);
$scope.waiting = "Waiting again...";
})
});