In Angular my eval() is not working in the correct context.
I just want to test it with something simple like eval('console.log(this.sharedservice.var1)'); but says Cannot read property 'sharedservice' of undefined, so it doesn't know what this is.
When I try to do (0, eval)(script); which solves the this problem, then it says Cannot read property 'var1' of undefined. So know it doesn't know what sharedservice is. But in my component's constructor I do have private sharedservice: SharedService,. How can help eval see my component's constructor values?
Please don't suggest not to use eval, so tired of this argument.