Repeat does not work - Angular

-2

I could not repeat the lines

<!DOCTYPE html>
<html>
<head>

    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.1.js"></script>
    <link href=
    "//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel=
    "stylesheet">
    <link href="main.css" rel="stylesheet">
    <style>
    table,
        th,
        td {
          border: 1px solid black;
          border-collapse: collapse;
        }

        th,
        td {
          padding: 5px;
        }
    </style>

    <title></title>
</head>

<body>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Avaliação 01</th>

                <th>Avaliação 02</th>

                <th>Avaliação 03</th>

                <th>Avaliação 04</th>

                <th>Avaliação 05</th>
            </tr>
        </thead>

        <tbody>
            <tr>
                <td>
                    <div>
                        <pre>
{{avaliacao.avalia_1}}
</pre>

                        <div class="btn-group" id="mode-group">
                            <label>S</label> <label>N</label> <label>AV</label>
                            <label>NA</label>
                        </div>
                    </div>
                </td>

                <td>
                    <div>
                        <pre>
{{avalia_2}}
</pre>

                        <div class="btn-group" id="mode-group">
                            <label>S</label> <label>N</label> <label>AV</label>
                            <label>NA</label>
                        </div>
                    </div>
                </td>

                <td>
                    <div>
                        <pre>
{{avalia_3}}
</pre>

                        <div class="btn-group" id="mode-group">
                            <label>S</label> <label>N</label> <label>AV</label>
                            <label>NA</label>
                        </div>
                    </div>
                </td>

                <td>
                    <div>
                        <pre>
{{avalia_4}}
</pre>

                        <div class="btn-group" id="mode-group">
                            <label>S</label> <label>N</label> <label>AV</label>
                            <label>NA</label>
                        </div>
                    </div>
                </td>

                <td>
                    <div>
                        <pre>
{{avalia_5}}
</pre>

                        <div class="btn-group" id="mode-group">
                            <label>S</label> <label>N</label> <label>AV</label>
                            <label>NA</label>
                        </div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table><script>
    angular.module('ui.bootstrap.demo', ['ui.bootstrap']);

        angular.module('ui.bootstrap.demo').controller('ButtonsCtrl', function($scope) {

          $scope.avaliacoes = [{
            avalia_1: 'S',
            avalia_2: 'AV',
            avalia_3: 'S'
          }, {
            avalia_1: 'S',
            avalia_2: 'NA',
            avalia_3: 'N'
          }, {
            avalia_1: 'S',
            avalia_2: 'AV',
            avalia_3: 'S'
          }, {
            avalia_1: 'S',
            avalia_2: 'NA',
            avalia_3: 'N'
          }, {
            avalia_1: 'S',
            avalia_2: 'AV',
            avalia_3: 'S'
          }];






        });
    </script>
</body>
</html>

link

    
asked by anonymous 01.08.2015 / 19:33

2 answers

0

The directive was missing from the table. I was using the Angular expressions in the table before putting the directive. It worked!

<table style="width:100%" ng-controller="ButtonsCtrl">
    
02.08.2015 / 18:45
1

Dude, I agree with what the colleagues said. But to give a help, I leave below an example of ngRepeater:

<tr ng-repeat="usuario in ListaUsuarios">
   <td>{{usuario.nome}}</td>
   <td>{{usuario.data | date: 'dd/MM/yyyy'}}</td>
</tr>

Javascript Code AngularJs:

app.controller("AngularController",
    ['$scope', "$http", function ($scope, $http) {
        var URLApi = "/WebApi/api/usuarios/";
        //Promessa

        $scope.amigos = "Olá amigos";
        $scope.ListaUsuarios = [
            {
                nome: "Tiago",
                data: "07/03/2017"
            }
        ];
}]);

I think this should clear up any doubt. abs.

    
02.08.2015 / 02:16