AngularJS Tutorial - Data binding for definition list








The following code shows how to do data binding for definition list.

Example


<!--from w  w  w. ja v  a2s  .com-->
<!DOCTYPE html>
<html  ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script type='text/javascript'>
function DemoCtrl($scope) {
    $scope.definitions = [{
        title: 'Foo',
        text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
    }, {
        title: 'Bar',
        text: 'Iste aperiam nesciunt enim dolorum dolores labore necessitatibus dolor?'
    }]
}
</script>
</head>
<body>
  <dl ng-app="" ng-controller="DemoCtrl">
  <dt ng-repeat-start="definition in definitions" ng-bind="definition.title"></dt>
  <dd ng-repeat-end="" ng-bind="definition.text"></dd>
</dl>
</body>
</html>

The code above is rendered as follows: