Controller.js
$scope.bookShow = false;
$scope.itemType = function(value) {
if(value=="book"){
$scope.bookShow=true;
}
else {
$scope.bookShow = false;
}
}
OR
$scope.bookShow = false;
$scope.itemType = function() {
$scope.bookShow=!$scope.bookShow;
}
HTML
<form class="form" ng-controller="formCtrl">
<h1 class="h1">Add a new Item</h1><br><br>
<input type="radio" name="check" value="dvd" ng-model="value" ng-checked="true" ng-change='itemType(value)'>DVD<br>
<input type="radio" name="check" value="book" ng-model="value" ng-change='itemType(value)'>Book<br>
<fieldset>
<p>ISBN:<br>
<input type="text" name="ISBN" ng-model="itemInput1" tabindex="1" required autofocus><br>
Title:<br>
<input type="text" name="Title" ng-model="itemInput2" tabindex="2" required><br>
</p>
</fieldset>
//CHANGED HERE
<div ng-show=!bookShow>
<fieldset>
<p>Sector DVD:<br>
<input type="text" name="Sector" ng-model="itemInput3" tabindex="3"><br>
Publication Date:<br>
<input type="text" name="Published" ng-model="itemInput4" tabindex="4"><br>
Authors:<br>
<input type="text" name="Authors" ng-model="itemInput5" tabindex="5"><br>
Publishers:<br>
<input type="text" name="Publishers" ng-model="itemInput6" tabindex="6"><br>
Page Count:<br>
<input type="text" name="Pages" ng-model="itemInput7" tabindex="7"><br></p>
</fieldset>
</div>
//CHANGED HERE
<div ng-show=bookShow>
<fieldset>
<p>Sector BOOK:<br>
<input type="text" name="Sector" ng-model="itemInput8" tabindex="3"><br>
Languages:<br>
<input type="text" name="Languages" ng-model="itemInput9" tabindex="4"><br>
Subtitles:<br>
<input type="text" name="Subtitles" ng-model="itemInput10" tabindex="5"><br>
Producers:<br>
<input type="text" name="Producers" ng-model="itemInput11" tabindex="6"><br>
Actors:<br>
<input type="text" name="Actors" ng-model="itemInput12" tabindex="7"><br></p>
</fieldset>
</div>
<input class="submit-button" type="submit" name="AddBook" value="Add" />
</form>