I would like to use AngularFire to record analytics events in Chrome, FF, and IE11. Not sure what extra configuration needs to be done to my app to use AngularFire code that is ES5 compatible.
Angular: 8.2.0
Firebase: 7.6.2
AngularFire: 5.3.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
OS: Windows 10
Browser: IE11
Steps to set up and reproduce
app.module.ts
AngularFireModule.initializeApp(env.firebase),
AngularFireAnalyticsModule,
components/directives
constructor(private firebase:AngularFireAnalytics, private el: ElementRef) { }
ngAfterViewInit(): void {
this.firebase.logEvent('view', this.attributes);
}
polyfills.ts
import 'core-js';
import 'proxy-polyfill/proxy.min'
import 'es6-promise';
import 'promise-polyfill';
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/array';
import 'core-js/es7/array'; // for .includes()
/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'classlist.js'; // Run npm install --save classlist.js.
* Errors in the JavaScript console *
Object doesn't support property or method 'logEvent'
Object doesn't support property or method 'setCurrentScreen'
I would like to use AngularFire to record analytics events in Chrome, FF, and IE11. Not sure what extra configuration needs to be done to my app to use AngularFire code that is ES5 compatible.
I have added polyfills and tsconfig to get my angular 8 app to load in IE11, but the AngularFire parts are throwing errors.
When I look at the AngularFireAnalytics class in the IE11 debugger it contains
options;
gtag;
analyticsInitialized;
updateConfig;
but it doesn't contain any of the properties from the AnalyticsProxy type
Hey there, our implementation isn鈥檛 quite compatible with the proxy polyfill a out there. I鈥檓 actively putting together a solution.
@jamesdaniels Is there any work around in the meantime? I'd be happy if I could disable Analytics on IE11.
Looks like a duplicate of https://github.com/angular/angularfire/issues/2296
You need proxy-polyfill, whatwg-fetch, and something like core-js to get functionality in IE 11. See the sample project in this project for a demo of IE functionality.
Most helpful comment
Hey there, our implementation isn鈥檛 quite compatible with the proxy polyfill a out there. I鈥檓 actively putting together a solution.