javascript - checkBox ng-Repeat from controller-data not Rendering : AngularJs -


i picking checkbox data controller file, not rendering properly. following html:

html:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> </head> <body ng-app="myapp" ng-controller="myctrl"> <table>     <tr ng-repeat="x in people">         <input type="checkbox" id="{{x.id}}" >{{x.name}}<br/>      </tr> </table> <button>click</button> <script> //module declaration var app = angular.module('myapp',[]); //controller declaration app.controller('myctrl',function($scope){     $scope.people = [         {name:"peter",id:"201"},         {name:"lina",id:"202"},         {name:"roger",id:"203"}     ]; }); </script> </body>  </html> 

expectation:

3 rows of input checkboxes names adjescent them

result:

enter image description here

there no js errors. can me out wrong in this?

just add "td" tag : jsfiddle

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> </head> <body ng-app="myapp" ng-controller="myctrl"> <table>     <tr ng-repeat="x in people">       <td>         <input type="checkbox" id="{{x.id}}" >{{x.name}}<br/>        </td>     </tr> </table> <button>click</button> <script> //module declaration var app = angular.module('myapp',[]); //controller declaration app.controller('myctrl',function($scope){     $scope.people = [         {name:"peter",id:"201"},         {name:"lina",id:"202"},         {name:"roger",id:"203"}     ]; }); </script> </body>  </html> 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -