UNPKG

1.63 kBSource Map (JSON)View Raw
1{"version":3,"file":"ng1.js","sourceRoot":"","sources":["../../../src/@ionic-native/core/ng1.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAY;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE;QACnD,IAAM,UAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAE3D,KAAK,IAAM,MAAI,IAAI,OAAO,EAAE;YAC1B,IAAM,WAAW,GAAG,UAAU,GAAG,MAAI,CAAC;YACtC,IAAM,GAAG,GAAG,OAAO,CAAC,MAAI,CAAC,CAAC;YAE1B,CAAC,UAAC,WAAW,EAAE,GAAG,EAAE,IAAI;gBACtB,UAAQ,CAAC,OAAO,CAAC,WAAW,EAAE;oBAC5B;wBACE,IAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBACvC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;wBAC/B,OAAO,KAAK,CAAC;oBACf,CAAC;iBACF,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE,MAAI,CAAC,CAAC;SAC5B;KACF;AACH,CAAC","sourcesContent":["declare const window: any;\n\n/**\n * Initialize the ionic.native Angular module if we're running in ng1.\n * This iterates through the list of registered plugins and dynamically\n * creates Angular 1 services of the form $cordovaSERVICE, ex: $cordovaStatusBar.\n */\nexport function initAngular1(plugins: any) {\n if (typeof window !== 'undefined' && window.angular) {\n const ngModule = window.angular.module('ionic.native', []);\n\n for (const name in plugins) {\n const serviceName = '$cordova' + name;\n const cls = plugins[name];\n\n ((serviceName, cls, name) => {\n ngModule.service(serviceName, [\n () => {\n const funcs = window.angular.copy(cls);\n funcs.__proto__['name'] = name;\n return funcs;\n },\n ]);\n })(serviceName, cls, name);\n }\n }\n}\n"]}
\No newline at end of file