Closed brentdb closed 6 years ago
Hi @brentdb, can you please clarify if you are using the latest version (2.7.0) of Winwheel.js, downloaded from here on Github? or have you installed it using NPM?
The version of Winwheel.js on NPM was not added by me, nor has it been updated for some time, so the change mentioned in that stackoverflow will not be present in the library.
As my career has taken the back-end development path, unfortunately I am unable to offer any assistance on trying to use Winwheel.js with modern JS frameworks such as Angular, React etc.
Hi @zarocknz,
Thank you for the response.
This was the NPM version of the plugin. Eventually, we used the Github version. My boss wrote a bit of angular to declared and initialized it in Angular and then used JS to create the wheel.
thank you
Hi, Thanks for the awesome job you've done on this plugin. I have not come across another js plugin for a lucky spinning wheel better than this one yet. I'm having an issue with the getIndicatedSegment property when calling the alert prize(); function in an Ionic 3/Angular 2 application. I've followed this issue https://stackoverflow.com/questions/44306571/how-to-use-winwheel-js-callback-in-angular2 and have gotten it to work with the app and spinning quite well.
When the alert prize function is called, I get this error:
TypeError: Cannot read property 'getIndicatedSegment' of undefined at alertPrize (http://localhost:8100/?ionicplatform=ios:51:41) at eval (eval at winwheelStopAnimation (http://localhost:8100/build/vendor.js:137240:13),:1:1)
at n.winwheelStopAnimation (http://localhost:8100/build/vendor.js:137240:13)
at n.callback (http://localhost:8100/assets/scripts/TweenMax.min.js:16:22797)
at n..render (http://localhost:8100/assets/scripts/TweenMax.min.js:14:4905)
at Object.n.render (http://localhost:8100/assets/scripts/TweenMax.min.js:16:27269)
at Object.O._updateRoot.D.render (http://localhost:8100/assets/scripts/TweenMax.min.js:16:31859)
at Object.n.dispatchEvent (http://localhost:8100/assets/scripts/TweenMax.min.js:16:19594)
at g (http://localhost:8100/assets/scripts/TweenMax.min.js:16:20122)
I've followed the advice in that answer and added the prize function in my index.html file in order to get access to the Prize callback that is in my page.ts file and show the alert on the basic example to alert the prize. However, when I am trying to access the getIndicatedSegment variable, I get this issue.
Here is the code in my LuckySpinPage.ts file:
export class LuckySpinPage { constructor(public navCtrl: NavController) { } wheel;
wheelSpinning = false;
}
The code in the index.html file:
My aim is to get the prize on a specific segment e.g alert you've won, when it lands on segment 4, or alert not prize won when landing on any other segment.