Cannot start my app after upgrading to 2.2
See original GitHub issueFrom @tomylee001001 on August 12, 2016 15:7
Hi , i upgraded the tns-core-modules to 2.2 and nativescript-angular 0.3 but after upgrading my apps login screen opens but when i click the login button i get the following error.
com.tns.NativeScriptException: Calling js method onClick failed
EXCEPTION: Error in pages/login/login.html:6:49 ORIGINAL EXCEPTION: Error: not implemented ORIGINAL STACKTRACE: Error: not implemented at NativeScriptDomAdapter.Parse5DomAdapter.getCookie (/data/data/org.nativescript.platformtest/files/app/tns_modules/@angular/platform-server/src/parse5_adapter.js:619:68) at CookieXSRFStrategy.configureRequest (/data/data/org.nativescript.platformtest/files/app/tns_modules/@angular/http/src/backends/xhr_backend.js:150:82) at XHRBackend.createConnection (/data/data/org.nativescript.platformtest/files/app/tns_modules/@angular/http/src/backends/xhr_backend.js:165:28) at httpRequest (/data/data/org.nativescript.platformtest/files/app/tns_modules/@angular/http/src/http.js:22:20) at Http.post (/data/data/org.nativescript.platformtest/files/app/tns_modules/@angular/http/src/http.js:78:16) at UserService.login (/data/data/org.nativescript.platformtest/files/app/pages/shared/user/user_service.js
My login html
<StackLayout #container> <Image src="res://id_logo" stretch="none" horizontalAlignment="center"></Image> <TextField hint=“E-Posta” keyboardType=“email” [(ngModel)]=“user.email” autocorrect=“false” autocapitalizationType=“none”></TextField> <TextField hint=“Şifre” secure=“true” [(ngModel)]=“user.password”></TextField>
<Button text="Giriş" class="submit-button" (tap)="submit()"></Button>
</StackLayout>
and my codes for submit
submit()
{
if (!this.user.isValidEmail()) {
alert("Enter a valid email address.");
return;
}
this._userService.login(this.user)
.subscribe(
() =>
{
console.log(Config.apiUrl);
console.log("|"+Config.user_.id+"|");
//alert("Giriş işlemi başarılı");
this._router.navigate(["/boardlist"]);
}
,
(error) => alert("Giriş işlemi başarısız."+error)
);
}
i had no problem before the upgrade.
Copied from original issue: NativeScript/NativeScript#2575
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (2 by maintainers)
In main.ts, I add NS_HTTP_PROVIDERS.
import {NS_HTTP_PROVIDERS} from ‘nativescript-angular/http’; … nativeScriptBootstrap(AppComponent, [NS_HTTP_PROVIDERS, APP_ROUTER_PROVIDERS]);
@tomylee001001: yes it solves the problem!