import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor() {
console.log(this.getColor(1000))
}
getColor(c:String) {
return c
}
}
My text editor put a red line bellow the 1000 that's says: Argument of type '1000' is not assignable to parameter of type 'String'.ts(2345)
Ok...but my app still executes and I can have the result on my console.
is there any how to make Angular and/or Typescript to prevent an execution in a scenario like this ?