Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorial</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="myCtrl"> <h3>ng-value directive in AngularJS Tutorial</h3> <h2>Select Tutorials</h2> <li ng-repeat="X in names"> {{X}} <input type="radio" ng-model="my.favorite" ng-value="X"> </li><br/> You choose <b>{{my.favorite}}</b> Tutorial </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.names = ['HTML', 'CSS', 'PHP']; $scope.my = { favorite: 'CSS' }; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.