angular-best-practices icon indicating copy to clipboard operation
angular-best-practices copied to clipboard

params without specifying type

Open devpato opened this issue 5 years ago • 0 comments

enroll(classId): Observable<any> {
    if (!this.currentUser)
      return Observable.throw('User not signed in');

    if (this.currentUser.classes.includes[classId])
      return Observable.throw('Already enrolled');

    this.currentUser.classes.push(classId);

    return Observable.empty().delay(1000);
  }

I noticed in several parts of you code you don't specify the param type. for example in the code above classId should be string or number

devpato avatar Sep 11 '19 23:09 devpato