Could someone please help me understand why my "Voted:" checkbox is not controlling the ng-if directive? Strangely enough, the "Keep HTML" checkbox is working fine.
<p>
<li ng-repeat="x in info">
{{x.name}} Voted:
<input type="checkbox"
ng-model="myVar"
ng-init="myVar =true">
</li>
</p>
<input type="checkbox" ng-model="myVar" ng-init="myVar =true">
<h1 ng-if="myVar">Welcome2</h1>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.myObj = {
"color": "white",
"background-color": "coral",
"font-size": "60px",
"padding": "50px"
}
$scope.info = [{
name: 'woon',
age: '18'
},
{
name: 'amir',
age: '17'
}];
});
</script>