When i run iOS xcode project with embedded nativescript frameworks and nativescript code, apps gives error when try to show/load nativescript pages into xcode console: Error: Error: A Frame must be used to navigate to a Page.
Below are the my Objective-c Function which starts loading NativeScript pages.
- (NSString*) scriptStringToLoad {
NSString *source = @"var platform_1 = require('nativescript-angular/platform');"
"var app_module_1 = require('./app/app.module');"
"var platform = platform_1.platformNativeScriptDynamic();"
"platform.bootstrapModule(app_module_1.AppModule);";
return source;
}
Below is NativeSctipt part:
- app.module.ts file code
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
@NgModule({
bootstrap: [
AppComponent
],
imports: [
NativeScriptModule,
AppRoutingModule
],
declarations: [
AppComponent
],
schemas: [
NO_ERRORS_SCHEMA
]
})
export class AppModule { }
app.component.ts file code
import { Component } from "@angular/core";
@Component({ moduleId: module.id, selector: "ns-app", templateUrl: "app.component.html" }) export class AppComponent {
onButtonTap() { console.log('Hi hello button tapped'); }
}
app.component.html file code
app.component.html
? – Manoj