rawls238 / PlanOut.js

A JavaScript port of Facebook's PlanOut Experimentation Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inputs is undefined

kasual1 opened this issue · comments

Hey guys,

for a project at my university I need to implement PlanOut. Since my web app runs on angular (v.5.0.0) I try to use PlanOut.js to integrate it into my project, but It seems like I'm missing something.

When I extend my class MyExperiment from Experiment it does not seem to override the constructor properly. When I try to create an experiment like this:

var exp = new MyExperiment({userId: 12 });
this.btnText =  exp.get('foo');

it tells me, that the constructor of MyExperiment should be empty instead of containing e.g. the userId

I can't figure out how to pass this input value (e.g. userId) to the super class.

I'm fairly new to angular and javascript in general so please don't be too condemning ;)
I'm also aware that you guys actually created PlanOut.js to work well with React, but I thought since it is a javascript library it also should run on angular as well.

When I fake the userId in the MyExperiment class I'm able to log the event just fine.
If you want me to explain things in more detail, just let me know!

Figured out how to do it. Thanks for your effort. Great library!