This question has already been answered:
- Scopes angular js 1 answer
The ng-switch value is not displayed, what could be the problem?
<!DOCTYPE html> <html ng-app="myApp"> <head> <title>HomeWork #3</title> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.2/semantic.min.css"> <script> var app = angular.module('myApp', []) .controller('mainCtrl', function ($scope) { $scope.items = [ { question: "Question 1", answer: ["1", "2", "3", "4"] }, { question: "Question 2", answer: ["1", "2", "3", "4"] }, ]; }) </script> </head> <body ng-controller="mainCtrl"> <div class="ui container"> <h1>HomeWork #3</h1> <div ng-repeat="item in items" class="ui radio checkbox"> <input ng-model="number" value="{{$index}}" name="radio" type="radio"> <label>{{item.question}}</label> </div> <div ng-switch on="number"> <div ng-switch-when="0"> 1 </div> <div ng-switch-when="1"> 2 </div> </div> </div> </body> </html>