mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
Merge branch 'master' into v5
This commit is contained in:
@@ -415,11 +415,11 @@ export function cordovaWarn(pluginName: string, method?: string): void {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export const wrap = function(
|
||||
export const wrap = (
|
||||
pluginObj: any,
|
||||
methodName: string,
|
||||
opts: CordovaOptions = {}
|
||||
): Function {
|
||||
) => {
|
||||
return (...args: any[]) => {
|
||||
if (opts.sync) {
|
||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||
|
||||
@@ -13,9 +13,9 @@ export function initAngular1(plugins: any) {
|
||||
const serviceName = '$cordova' + name;
|
||||
const cls = plugins[name];
|
||||
|
||||
(function(serviceName, cls, name) {
|
||||
((serviceName, cls, name) => {
|
||||
ngModule.service(serviceName, [
|
||||
function() {
|
||||
() => {
|
||||
const funcs = window.angular.copy(cls);
|
||||
funcs.__proto__['name'] = name;
|
||||
return funcs;
|
||||
|
||||
Reference in New Issue
Block a user