ng-optimizely
ng-optimizely copied to clipboard
Difficult to Access Optimizely Data Object
As per the Optimizely JS API users may sometimes wish to access the Optimizely Data Object.
This object can be tricky to load within Angular's scope. I'm currently able to load the object from the callback on loadProject
promise = optimizely.loadProject(id);
promise.then(function(resp){
var projectSettings = resp;
});
While it's possible to do manually, it might be nice to have method on this directive for returning the current project's data object? If the project isn't loaded yet, it could return a promise. For example:
optimizely.projectSettings();
// or
promise = optimizely.projectSettings();
promise.then(function(resp){
var projectSettings = resp;
})
Thanks for creating ng-optimizely!
This sounds pretty do-able. Would you care to submit a pull request with your proposed changes and relevant documentation? I can take it on myself but it might be a little bit before I can start the work.