When you write a .js file, you will need to provide a static block ie
static get parameters() { return [[NavController]]; }
to get the type nav , which is inside the contructor parameter.
but in the .ts file, you do not need to define a static block, you can just define it inside the constructor, for example:
constructor (nav : NavController) {}
you can think of it as nav is a variable and NavController is a type.
This is why you got the error. You used the typescript (. Ts) syntax in the javascript (.js) file.
So, the next time you look at the tutorial, try to find out if the tutor is working with a .js or .ts file :-)
Hope this helps.
hackSlanger
source share