JSFiddle - React, Tailwind, and code Playground
by Curt
HTML
<div class="container" ng-app="myapp" ng-controller="mainctrl">
<div ng-repeat="item in x">
<input type="radio" name="randName" ng-value="item.value" ng-model="variable">
</div>
<rand-dir number="variable"></rand-dir>
</div>
JavaScript
angular.module('myapp', [])
.controller('mainctrl', ['$scope', function($scope){
$scope.x = [{value:1},{value:2},{value:3},{value:4},{value:5}];
$scope.variable = 0;
}])
.directive('randDir', function() {
return {
restrict: 'E',
scope: {
number: '=',
},
link: function($scope) {
console.log($scope.number);
}
};
});