自Google AppEngine 1.8.5开始,在开发环境中出现了一个新警告:
WARNING 2013-09-27 10:10:53,035 api_config.py:1768] Method specifies path
parameters but you are not using a ResourceContainer. This will fail in future
releases; please switch to using ResourceContainer as soon as possible.
Run Code Online (Sandbox Code Playgroud)
什么是ResourceContainers以及如何使用它们?
使用Appstats,我可以很好地了解我的应用程序的RPC性能.
如何在Appstats仪表板中显示端点请求?
在 JavaScript 中,可以在关闭窗口之前打开确认对话框。
例子:
window.onbeforeunload = function(){
return "Please don't go!";
};
Run Code Online (Sandbox Code Playgroud)
如何在 Dart 中实现同样的目标?
我有一个CustomPassword组件,并希望提供一种方法isActive,允许您检索组件是否仍然是此网站上的活动元素.
示例代码:
custom_password.html
<polymer-element name="custom-password">
<template>
<div>Other things here</div>
<input id="password-field" type="password" value="{{value}}">
</template>
<script type="application/dart" src="custom_password.dart"></script>
</polymer-element>
Run Code Online (Sandbox Code Playgroud)
custom_password.dart
import 'package:polymer/polymer.dart';
@CustomTag('custom-password')
class CustomPassword extends PolymerElement {
@published
String value;
CustomPassword.created() : super.created() {
}
bool isActive() {
// TODO figure out if the CustomPassword element is still active.
return false;
}
}
Run Code Online (Sandbox Code Playgroud)