Duvida em angularJS
Segue o script abaixo, nao esta imprimindo as variaveis que peguei do banco {{metagenerica.nome}} .. nenhuma delas, mas nao consigo achar o erro. a conexao esta correta
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="lib/bootstrap/bootstrap.min.css">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<link rel="stylesheet" type="text/css" href="estilos.css">
<script src="lib/angular/angular.js"></script>
<title>Cadastro Meta</title>
<style>
<!--
.textBox { border:1px solid gray; width:200px;}
-->
</style>
<script>
angular.module("cadastroDaMeta",[]);
angular.module("cadastroDaMeta").controller("cadastroDaMetaCtrl", function($scope,$http){
$scope.cadastrados = "Metas Genericas cadastradas";
$scope.cadastrar= "Cadastrar nova Meta Generica"
$scope.listarMetasG=function(){
$http.get("selecionametasgenericas.php")
.success(function(data){
$scope.data=data;
})
}
$scope.listarMetasG();
})
</script>
</head>
<body ng-controller="cadastroDaMetaCtrl">
<div>
<script type="text/javascript">$scope.listarMetasG();</script>
<form id="form1" name="form1" method="post" action="insere_metagenerica.php">
<table width="400" border="0" align="center">
<tr>
<td width="145">Sigla</td>
<td width="245"><input name="sigla" type="text" id="sigla" maxlength="45" class="textBox" /></td>
</tr>
<tr>
<td width="145">Nome</td>
<td width="245"><input name="nome" type="text" id="nome" maxlength="45" class="textBox" /></td>
</tr>
<tr>
<tr>
<td width="145">Descrição</td>
<td width="245"><input name="descricao" type="text" id="descricao" maxlength="45" class="textBox" /></td>
</tr>
<td>Nível de capacidade</td>
<td><select name="nivel_capacidade" id="nivel_capacidade" class="textBox" >
<option value="0">Selecione...</option>
<?php
require_once ("conexaodb.php");
$lista=$dbhandle->query("SELECT * FROM nivel_capacidade");
while ($x=$lista->fetch_array()) {
$id = $x["id"];
$nivel_capacidade = $x["nome"];
echo "<option value='$nivel_capacidade'\'>$nivel_capacidade</option>\n";
}
?>
</select></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Salvar" style="cursor:pointer;" /></td>
</tr>
</table>
</form>
<div id="jumbotron">
<table class="table table-striped">
<tr>
<th>Meta</th>
<th>Sigla</th>
<th>Descrição</th>
<th>Opção</th>
</tr>
<tr ng-repeat="metagenerica in data">
<td>{{metagenerica.nome}}</td>
<td>{{metagenerica.sigla}}</td>
<td>{{metagenerica.descricao}}</td>
<td>
<!-- <a href="deletar.php?id=".meta_generica.id><button>Deletar</button></a></td> -->
<a href="deletar.php?id={{meta_generica.id}}"><button>Deletar</button></a></td>
</tr>
</table>
</div>
</div>
</body>
</html>Discussão (0)
Carregando comentários...