可以在一个单独的HTML中检索多个html部分吗?我有下一个情况:
Template: {header} {main} {footer}
/index: header:"Welcome" main:"welcome text" footer:""
/help: header:"Help title" main:"faq tips" footer"Back to home"
Run Code Online (Sandbox Code Playgroud)
使用ng-include我要从服务器上检索6个html.如果我将在一个html中检索多个部分,那么我将仅从服务器检索2个html,一个用于/ index,一个用于/ help.
谢谢!
更新04/07/12:
我寻求一次更新多个div,并使用独特的html retreive.我不喜欢这个:
function IndexCtrl($scope) {
$scope.mainPage = 'partials/index/index.html';
$scope.headerTemplate = 'partials/index/header.html';
$scope.footerTemplate = 'partials/index/footer.html';
}
Run Code Online (Sandbox Code Playgroud)
在模板中使用ng-includes包括这些部分.我认为这不是正确的方法.还有其他方法吗?
谢谢!
根据浏览器的不同,我对请求的编码有一些问题.
下面的转储显示FF和Chrome之间不同的标题(我删除了所有相同的标题).查看"搜索"值的表示:
Firefox:好的
Accept-Language: es-ar,es;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
POST: {"data":{"size":10,"search":"José","order":"name","page":1}}
Run Code Online (Sandbox Code Playgroud)
Chrome:不行
Pragma: no-cache
Cache-Control: no-cache
Origin: http://localhost
Content-Type: application/json;charset=UTF-8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: es-ES,es;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
POST: {"data":{"size":10,"search":"José","order":"name","page":1}}
Run Code Online (Sandbox Code Playgroud)
IE不工作
我试图在$ http中强制使用Content-Type,但没有.两个浏览器中的响应都正常.我正在使用Apache而不是Win 7"por si las moscas".
重要提示:请求在发送到服务器之前格式不正确,上面的标题我将从Firebug和Chrome中检查.
任何的想法?谢谢!
何塞
UPDATE
我把url编码到帖子,并在服务器中解码,我注意到使用UTF-8 url解码工作不好,但ISO-8859-1工作正常.然后浏览器发送ISO-8859-1的帖子?