Open gianlazz opened 7 years ago
I just realized that code doesn't stop when you click it again. It just goes faster
How do I define functions in ionic? It's throwing an error when I paste in the JS from that repo.
https://stackoverflow.com/questions/43308964/ionic-2-how-define-a-function-in-ionic-2
I will have to make sure the scope of the string variable OCR --> RSVP works. I may have to look into defining global variables in ionic.
When I past in the js from that repo it says "Cannot find name '$'."
It looks like I need to npm install jquery
npm install --save-dev @types/jquery
https://stackoverflow.com/questions/38283236/typescript-and-jquery-compile-error-cannot-find-name https://stackoverflow.com/questions/41168683/cannot-find-name-in-ts-file-unless-referenced-in-every-file
import * as $ from "jquery";
https://stackoverflow.com/questions/40994719/cannot-find-name-jquery-in-angular2
3 Steps:
npm install jquery --save
npm install @types/jquery --save
import * as $ from 'jquery';
I need to learn how to interact with the DOM with this framework
Where do I properly define methods in angular? I'm having variable scope issues with the runRSVP()
Algorithm:
Changing the wpm algorithm:
How do I get the index number of an array?
https://stackoverflow.com/questions/35207093/array-indexof-in-typescript-javascript
indexOf
This is my current attempt. I'm definitely almost there.
Put this in the constructor
this.rsvp()
public rsvp() {
console.log(this.demoString.split(/[\s]+/));
let splitStringArray = this.demoString.split(/[\s]+/);
let index = 3;
console.log(splitStringArray[index])
console.log(splitStringArray.length)
//this.rsvpString = splitStringArray[3];
while (index < splitStringArray.length){
this.rsvpString = splitStringArray[index]
setTimeout(index++, 1000)
//index++
console.log(index)
}
}
Touch text to start RSVP
Here's an open source repo with a basic JS implementation https://github.com/lordvon/SpeedyReader https://codepen.io/gianlazzarini/pen/VzeBzM