需要一些帮助将Google Transliterate与角度项目集成在一起,下面是将DOM中所有所需元素作为Transliteratable的片段.
function za() {
google.load("elements", "1", {packages: "transliteration"});
google.setOnLoadCallback(procTA);
}
// calls the helper function for each of input as well as textarea elememnts in the page
function procTA() {
procTAHelp('textarea');
procTAHelp('input');
}
// for each element of xtype (input or textarea), it creates another attribute
// whose name is <xtype><counter>id. That way each element gets a new
// attribute name (which acts as an identifier for the transliteration process
// and a flag which check whether to enable …Run Code Online (Sandbox Code Playgroud)