angularnativescriptangular2-nativescript

Nativescript Angular cannot find module "nativescript-angular/forms"


I am going through a tutorial that requires an import from "nativescript-angular/forms" for binding but I am getting an error that says

Cannot find module 'nativescript-angular/forms' or its corresponding type declarations.ts(2307)

import { NativeScriptFormsModule } from 'nativescript-angular/forms';

How can I fix this?


Solution

  • Since Nativescript 7, the imports for Angular related modules are updated to @nativescript/angular. The updated version of your code should look something like:

    import { NativeScriptFormsModule } from '@nativescript/angular';