我想为Google App Engine配置我的web.xml,但我的配置不起作用.我想更改默认index.html用WebApp/index.html.
这是web.xml:
<servlet>
<servlet-name>App</servlet-name>
<servlet-class>bg.app.AppServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>App</servlet-name>
<url-pattern>/WebApp/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>WebApp/index.html</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud) 我尝试实现一个指令,该指令必须使用angular-notation {{...}}更新特定的代码块.问题是更新的代码不再编译.
指令:
.directive('i18n', [function() {
'use strict';
return function(scope, element) {
var bindLabel = '{{labels.' + element.text() + '}}',
//create an empty object
obj = {
};
obj[element.text()] = '';
//extend the labels
angular.extend(scope.labels, obj);
element.text(bindLabel);
};
}])
Run Code Online (Sandbox Code Playgroud)
简单的HTML代码:
<title i18n>title</title>
Run Code Online (Sandbox Code Playgroud)
编译后的HTML代码:
<title i18n="">{{labels.title}}</title>
Run Code Online (Sandbox Code Playgroud)
期望的输出:
<title i18n="">This is my title :)</title>
Run Code Online (Sandbox Code Playgroud)
这{{labels.title}}是在控制器中实现的.
谢谢您的帮助!