I was reading through some Angular documentation and the following code has stumped me. Specifically, there is a a call to a method named resolve
, but sandwiched between the parenthesis and the method name is a "!".
clicked() {
if (this.arrived) {
this.reset();
} else {
this.resolve!('hi there!'); \\<-- Here?
this.arrived = true;
}
}
I've never seen this before. Why is there a bang after the method name? I've tried to search for this and I can't find an answer. Also, I'm not sure if this is a TypeScript or JavaScript thing.
For reference, the Angular reference document is the page on the AsyncPipe object. The code is in the second to last code snippet, close to the bottom of the snippet. What is this code doing?