angular empty fiddle

http://angularjs.org/

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"></script>
<ul ng-controller="myCtrl">
    <li ng-repeat="item in items" class="ng-cloak" ng-init="flag = flagCondition($index)">
        {{item}}.
        <span ng-show="flag">the flag is true!</span>
        <span ng-hide="flag">the flag is false!</span>
        {{flag}}.
    </li>
</ul>

JavaScript

angular
.module('myApp', [])

// controller here
.controller('myCtrl', function($scope) {
    $scope.flagCondition = function(index) {
        return Math.random() > .5;
    };
    
    $scope.items = 'abcdefghijklmn'.split('');
});