rrweb
rrweb copied to clipboard
How to use this in Angular
Ive installed it via NPM but don't know how to import this Plugin to use it? Would it be possible to extend the readme to include how to import it
ok im stupid sorry. just import it from 'rrweb/lib/rrweb.js'
Just for the reference of the people trying to implement this in Angular. While I was trying to use it like:
import { record, Replayer } from 'rrweb';
it started giving me Errors for Typescript typings as:
ERROR in node_modules/rrweb/typings/types.d.ts(278,38): error TS1005: ';' expected.
node_modules/rrweb/typings/types.d.ts(278,65): error TS1005: '=' expected.
webpack: Failed to compile.
Then, to make it work, I changed it like:
import * as rrweb from 'rrweb/lib/rrweb.js';
// And then use it like
rrweb.record({
// Event handler which will be triggerred for each Event by User on the page
emit(event) {
// Send the event anywhere
}
});
Angular Version: 5.2.11