I would like to make a frame with AngularJS data
Populatingthedataviajsonlikethis:
Example:date="" 01/01/2015 "but, the will only be shown the day
The table is looped
<div ng-app="myApp" ng-controller="myCtrl">
<table class="table table-striped" border="1">
<?php
echo "<tr>";
$diadasemana = date("w", mktime(0, 0, 0, $mes, 1, $ano));
$total = 35 - $diadasemana;
if (($diadasemana == 0) and $dias == 28)
{
$total = 28;
}
for ($i = 1; $i <= $total; $i++)
{
$diadasemana = date("w", mktime(0, 0, 0, $mes, $i, $ano));
$cont = 0;
if ($i == 1)
{
while ($cont < $diadasemana)
{
echo "<td></td>";
$cont++;
}
}
echo "<td><center>";
?>
<div> <?php
echo $i; ?></div>
<?php
echo "</center></td>";
if ($diadasemana == 6)
{
echo "</tr>";
echo "<tr>";
}
}
echo "</tr>";
?>
</table>
</div>
The json data
[
{
"id":1,
"ano_letivo":2016,
"escola_cod":"31011975",
"dia":"01/01/2016",
"situacao":"feriado"
},
{
"id":2,
"ano":2015,
"escola_cod":"31011975",
"dia":"02/01/2016",
"situacao":"recesso"
},
{
"id":3,
"ano":2015,
"escola_cod":"31011975",
"dia":"03/01/2016",
"situacao":"recesso"
},
{
"id":4,
"ano":2015,
"escola_cod":"31011975",
"dia":"04/01/2016",
"situacao":"dia letivo"
}
]
the variable $ i should be {{dia}}