【发布时间】:2014-04-24 19:14:03
【问题描述】:
我正在使用 angular-seo 但它不渲染 ui-view 内容。
我的设置:
.config(function($locationProvider,$stateProvider) {
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
$stateProvider
.state('index', {
url: '/',
templateUrl: 'src/app/default/site/site.tpl.html',
controller: 'IndexCtrl'
})
.state('blog', {
url: '/blog',
templateUrl: 'src/app/default/blog/blog.tpl.html',
resolve: {
posts: function(Post){
return Post.all();
}
},
controller: 'BlogIndexCtrl'
})
})
<meta name="fragment" content="!" />
angular.module('app', ['seo']);
.controller('BlogIndexCtrl', function ($scope,posts) {
$scope.posts = posts;
$scope.htmlReady();
})
phantomjs --disk-cache=no ~/vendor/angular-seo/angular-seo-server.js 5000 http://localhost
但是当我跑步时
curl 'http://localhost:3000/?_escaped_fragment_=/blog'
我只得到没有内部 ui-view 内容的 html :(
怎么了?
【问题讨论】: