When I do routing with the id parameter ends in white page. link
My app starts the posts appear, so I click on the post it goes to the other page and "it was to appear the content" but everything goes 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's what's in the Listing:
app.controller('listagemPost', function($scope, $http){
$http.get('http://www.denertroquatte.com.br/database.php')
.success(function(data, status, headers, config) {
$scope.items = data;
});
})