0

In my TS file, i have a declaration like

import { Select } from '@ngxs/store';
@Injectable()
export class someService {
@Select(someSELECTOR) varName$!: Observable<someType[]>;

  elements$ = this.varName$.pipe(
    map(elements => elements.map(SOMElogic),
  );
}

My question is in "varName$!", I know we use $ for representing observable, any idea what ! represents. Its not part of variable name, as when it is used below with pipe the ! is missing.

Does it represent anything in NGXS or Typscript or Angular.

ismail baig
  • 861
  • 2
  • 11
  • 39

1 Answers1

1

Have a look at this post The "!" is the non-null-assertion operator of TypeScript. It doesn't represent anything NGRX or Angular specific.

SaschaLeh
  • 198
  • 9