Google云端存储的搜索功能(Search capabilities with Google Cloud Storage)
我将使用Google的基础设施来存储文件,而我在Google云端硬盘和Google云端存储之间犹豫不决。 我不认为我会存储大量数据(小于50GB)。 不过,我想通过文件内容(全文)向我的用户提供搜索功能。 我知道它适用于Google云端硬盘SDK https://developers.google.com/drive/search-parameters,但我不确定它适用于Google云端存储文件吗? 我不想强迫我的用户有一个谷歌帐户,他们将能够共享文件给他人,他们将通过我的网站做所有的东西。
还有一个问题,有没有一种方法可以管理Google API的身份(创建/更新用户)? 没有Gmail帐户?
谢谢
I'm going to use Google's infrastructure to store files and I hesitate between Google Drive and Google Cloud Storage. I don't think I'll store a lot of data (less than 50GB). However I would like to offer search functionality through files contents (FULL TEXT) to my users. I know it's available with Google Drive SDK https://developers.google.com/drive/search-parameters but I'm not sure it is for Google Cloud Storage files ? I don't want to force my users to have a google account and they will be able to share files to others, and they will do all their stuff through my web site.
One more question, is there a way to manage identities with a Google API (create/update users) ? without a gmail account ?
thanks
原文:https://stackoverflow.com/questions/16397918
最满意答案
根据Typescript的规范, “this”指的是方法所属的类的实例。
您可以使用传递给回调的事件对象的target属性:
class foo { public test(evt){ alert($(evt.target).data("id")); // "undefined" console.log($(evt.target)); } }
或者是
event.currentTarget
取决于你想获得实际点击的元素还是获取事件的元素。According to Typescript's spec "this" is referring to the instance of class the method belongs to/is called on.
You could use the target attribute of the event object passed to the callback:
class foo { public test(evt){ alert($(evt.target).data("id")); // "undefined" console.log($(evt.target)); } }
Or
event.currentTarget
depending on if you want to get the element actually clicked on or the element which captured the event.
相关问答
更多-
根据Typescript的规范, “this”指的是方法所属的类的实例。 您可以使用传递给回调的事件对象的target属性: class foo { public test(evt){ alert($(evt.target).data("id")); // "undefined" console.log($(evt.target)); } } 或者是event.currentTarget取决于你想获得实际点击的元素还是获取事件的元素。 According to Typescript ...
-
TypeScript with Jquery(TypeScript with Jquery)[2022-02-23]
你得到一个运行时错误,因为你没有正确加载JQuery,如果问题出现在那个问题上,那么你会看到编译器错误。 查看现有问题: Uncaught ReferenceError:$未定义? You're getting a runtime error because you haven't loaded JQuery properly, if the issue was with the typings then you would've seen a compiler error. See existing qu ... -
jQuery插件(和其他基于插件的库)的问题是,您不仅需要基础库的library.d.ts文件,而且还需要每个插件的plugin.d.ts文件。 不知何故,plugin.d.ts文件需要扩展library.d.ts文件中定义的库接口。 幸运的是,TypeScript有一个很漂亮的小功能,可以让你做到这一点。 对于classes ,目前只能在项目中对类进行单一的定义。 所以如果你定义一个class Foo ,你放在class Foo的成员就是你所得到的。 Foo任何其他定义将导致错误。 然而,使用interf ...
-
所以说没有用于确保一个方法总是被绑定到它的this指针的类型脚本(这不仅仅是一个jQuery问题)。这并不意味着没有一个相当简单的方法来解决这个问题。 您需要的是为您的方法生成代理,以在调用回调之前还原this指针。 然后,在将该代理传递到事件之前,需要将该回调函数包装起来。 jQuery有一个内置的机制,称为jQuery.proxy() 。 以上是使用该方法的上述代码的示例(请注意添加的$.proxy()调用。) class Editor { textarea: JQuery; co ...
-
我仍然想使用jquery,但我不明白如何将此用法转换为Typescript需要工作的内容。 将该函数移出该类并从该类中调用它。 或者创建一个self变量来同时使用this (class)和this (jquery)。 更多 https://basarat.gitbooks.io/typescript/content/docs/arrow-functions.html#tip-arrow-functions-with-libraries-that-use-this I still want to use jq ...
-
尝试更改evt:EventTarget以evt:JQuery.Event try changing evt: EventTarget to evt: JQuery.Event
-
事实证明,从JQuery加载了单独的Event接口。 我开始工作的方式是将事件类型分配给JQuery.Event。 即: import * as $ from 'jquery' export class Test { ele: JQuery; constructor() { this.ele = $('Hello World'); this.ele.mousedown((evt) => { this.my_mousedown(evt); }); } ...
-
好的,总结一下你的问题,你试图使用jQuery来挂钩(和取消)DOM元素上的事件,但是你希望事件处理程序的'this'上下文指向包含事件处理程序的类。 有多种方法可以解决这个问题。 首先,您可以使用jQuery.proxy class LoginDialog { public OpenHandler(context: LoginDialog, event: Event, ui: DialogUIParams) { $(window).on("scroll", $.proxy(conte ...
-
Typescript这个关键字在jquery事件处理程序中不起作用(Typescript this keyword not working in a jquery event handler)[2023-06-22]
也许做一个更经典的JavaScript方式可以解决它,与功能而不是箭头功能。 var that = this; $('').on('change paste keyup', function() { that.myProperty = $(this).val; that.change(); }).appendTo(result); Maybe do a more classic javas ... -
这不是一个错误。 它是一个计划的功能。 这是因为一旦定义了索引器,它也可以用于访问属性,因此属性需要是索引器的子类型。 例如: interface Foo{ [x:string]:number; // Now all properties must be subtypes of number bar:number ; // okay baz:string ; // Error } 试试吧 你可以在这里找到工作的Jquery定义: https : //github.com/b ...