kipris kipris - 3 months ago 14x
AngularJS Question

Ng-if boolean condition issue

I trying to show button if

isNotRegistered == true
and hide nested links. And if it's
hide the button and show links.
Why do in my plunker all links hide?


I assume the names would turn into links... Check this out... Kindly correct me if i misinterpreted it.

angular.module("App", [])
  .controller("Ctrl", function($scope){
    $scope.list = [
      {item: '1',
        isNotRegistered: false,
        children: [ 
        {name: '11'},
        {name: '12'}
      {item: '2',
        isNotRegistered: true,
        children: [ 
        {name: '21'},
        {name: '22'}
<script src=""></script>
<div ng-app="App" ng-controller="Ctrl">
      <li ng-repeat="item in list">{{item.item}}
          <li ng-if="item.isNotRegistered" ng-repeat="child in item.children">{{}}</li>
          <button ng-if="!item.isNotRegistered">Click</button>