0
When I routing with id parameter ends on white page. http://denertroquatte.com.br/app
My app starts appears the posts, so I click on the post it goes to the other page and "was to appear content" but it is all blank.
var app = angular.module('app', ['ngRoute', 'ngAnimate', 'ngSanitize']);
app.config(function($routeProvider){
$routeProvider
.when('/', {
templateUrl: 'inicio.html'
})
.when('/sobre',{
templateUrl: 'sobre.html'
})
.when('/post/:postId',{
templateUrl: 'post.html',
controller: 'mostrarPost'
})
});
//Aqui que se encontra o problema.
app.controller('mostrarPost', function($scope, $routeParams, $http){
$http.get('http://www.denertroquatte.com.br/database.php').success(function(data, status, headers, config){
angular.forEach(data, function(item) {
if (item.id_postagem == $routeParams.postId)
$scope.i = $scope.items[$routeParams.id_postagem]
});
});
});
And here follows the List:
app.controller('listagemPost', function($scope, $http){
$http.get('http://www.denertroquatte.com.br/database.php')
.success(function(data, status, headers, config) {
$scope.items = data;
});
})
Need to be in Jsfiddle? Upload the application to the http://denertroquatte.com.br/app Thank you!
– Dener Troquatte
When asking for more information about the question/problem, use the comment area. Use the answer button only when answering a question.
– emanuelsn
Jean didn’t work out. He still has the same problem =/
– Dener Troquatte