Angular2: How to subscribe to Http.post observable inside a service and a component properly?
问题 For a JWT authentification, I make a post request to get the token using the new Http module working with Observables now. I have a simple Login component showing the form: @Component({ selector: 'my-login', template: `<form (submit)="submitForm($event)"> <input [(ngModel)]="cred.username" type="text" required autofocus> <input [(ngModel)]="cred.password" type="password" required> <button type="submit">Connexion</button> </form>` }) export class LoginComponent { private cred: CredentialsModel