Trying to open a dialog:
const options: ModalDialogOptions = {
context: { promptMsg: "Add a new contact" },
fullscreen: fullscreen,
viewContainerRef: this.vcRef
};
this.modal.showModal(ModalContent, options)
I get this compiler error:
file: 'file:///Users/me/projects/myproject/app.component.ts' severity: 'Error' message: 'Type '{ context: { promptMsg: string; }; fullscreen: boolean; viewContainerRef: ViewContainerRef; }' is not assignable to type 'ModalDialogOptions'. Types of property 'viewContainerRef' are incompatible. Type 'ViewContainerRef' is not assignable to type 'ViewContainerRef'. Two different types with this name exist, but they are unrelated. Types of property 'createComponent' are incompatible. Type '<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?...' is not assignable to type '<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?...'. Two different types with this name exist, but they are unrelated. Types of parameters 'componentFactory' and 'componentFactory' are incompatible. Type 'ComponentFactory<any>' is not assignable to type 'ComponentFactory<any>'. Two different types with this name exist, but they are unrelated. Types have separate declarations of a private property '_viewClass'.' at: '63,11' source: 'ts'
I have seen this error when the app contains two versions of the Angular codebase: usually one in node_modules/@angular/..., another in node_modules/nativescript-angular/node_modules/@angular/....
The solution is to make sure your Angular-related project dependencies have the same versions as the ones that nativescript-angular depends on.
Most helpful comment
I have seen this error when the app contains two versions of the Angular codebase: usually one in
node_modules/@angular/..., another innode_modules/nativescript-angular/node_modules/@angular/....The solution is to make sure your Angular-related project dependencies have the same versions as the ones that
nativescript-angulardepends on.