I’m sort of surprised that the error isn’t on this.loginForm.username
and this.loginForm.password
. I thought those had to hang off of controls
, like this.loginForm.controls.username
.
As a side note, your service methods use the explicit promise constructor antipattern. I see this particular boilerplate a lot on these forums, so I assume that it comes from some sort of generator. If anybody knows exactly which driftyco project it comes from, I’ll open an issue about it. Bottom line: it probably makes the most sense to just return the underlying Observable
. If you really really want a Promise
instead, use Observable.toPromise
instead of creating a Promise
from scratch.