node.jsangulartypescriptnativescript

NativeScript Error NG8001: 'ActionBar' is not a known element


My startupscreen.module.ts looks like this:

import { NativeScriptFormsModule } from "@nativescript/angular";
import { NativeScriptCommonModule } from "@nativescript/angular/common";
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { StartupscreenComponent } from "./startupscreen.component";


@NgModule({
  imports: [
    NativeScriptFormsModule,
    NativeScriptCommonModule
  ],
  declarations: [
    StartupscreenComponent
  ],
  schemas: [
    NO_ERRORS_SCHEMA
  ],
})
export class StartupscreenModule { }

My app.module.ts looks like this:

import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptFormsModule, NativeScriptModule } from "@nativescript/angular";
import { FormsModule} from '@angular/forms'

import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { BrowserModule } from '@angular/platform-browser';
import { StartupscreenModule } from "./startupscreen/startupscreen.module";

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        FormsModule,
        BrowserModule,
        NativeScriptModule,
        NativeScriptFormsModule,
        AppRoutingModule,
        NativeScriptFormsModule,
        StartupscreenModule,
    ],
    declarations: [
        AppComponent
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class AppModule { }

And i always get that error whencompiling. Everything should be running.

My Path looks like this:

enter image description here

Full Error:

ERROR in ./app/startupscreen/startupscreen.module.ts
Module not found: Error: Can't resolve '@nativescript/angular/common' in 'E:\Users\SwaX\Desktop\MorseChat\src\app\startupscreen'
 @ ./app/startupscreen/startupscreen.module.ts 2:0-72 11:12-36 14:8-32 20:20-44
 @ ./app/app.module.ts
 @ ./main.ts
Error from chokidar (E:\): Error: EBUSY: resource busy or locked, lstat 'E:\swapfile.sys'
(node:11364) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'E:\Users\Default User'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
(node:11364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

And after i remove the Startupscreen in the app.module.ts it says that it cannot find .

startupscreen.component.html:

<ActionBar title="Startupscreen">
    <NavigationButton (tap)="onBackTap()" android.systemIcon="ic_menu_back"></NavigationButton>
</ActionBar>

<StackLayout class="page">
    <StackLayout class="box box-1">
        <Label textWrap="true" text="Bitte hier klicken wenn Sie sehen können."></Label>
    </StackLayout>
    <StackLayout class="box box-2">
        <Label textWrap="true" text="Bitte hier klicken wenn Sie Taubblind sind."></Label>
    </StackLayout>
</StackLayout>

Solution

  • I believe that the path for NativescriptCommonModule is just @nativescript/angular similar to NativeScriptFormsModule

    import { NativeScriptCommonModule } from "@nativescript/angular";